Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AKTIN
dwh-import
Commits
a9c7f316
Commit
a9c7f316
authored
Nov 17, 2017
by
R.W.Majeed
Browse files
fixed location header to conform to FHIR specs
parent
86172058
Changes
1
Show whitespace changes
Inline
Side-by-side
cda-server/src/main/java/org/aktin/cda/etl/fhir/Binary.java
View file @
a9c7f316
...
...
@@ -3,7 +3,6 @@ package org.aktin.cda.etl.fhir;
import
java.io.BufferedWriter
;
import
java.io.IOException
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
...
...
@@ -136,6 +135,7 @@ public class Binary implements ExternalInterface{
String
templateId
=
null
;
boolean
isValid
=
false
;
boolean
importSuccessful
=
false
;
URI
location
=
null
;
Document
cda
=
null
;
try
{
cda
=
parser
.
buildDOM
(
doc
);
...
...
@@ -153,20 +153,18 @@ public class Binary implements ExternalInterface{
// otherwise return HTTP_BAD_REQUEST
// process document
CDAStatus
stat
=
processor
.
createOrUpdate
(
cda
,
documentId
,
templateId
);
// check whether document was created or updated, return 201 or 200
if
(
stat
.
getStatus
()
==
Status
.
Created
){
try
{
URI
location
=
new
URI
(
"Binary/
?_id=
"
+
stat
.
getDocumentId
());
// create location conforming to FHIR specification
location
=
URI
.
create
(
"Binary/"
+
stat
.
getDocumentId
()
+
"/_history/0"
);
response
=
Response
.
created
(
location
);
}
catch
(
URISyntaxException
e
)
{
log
.
log
(
Level
.
WARNING
,
"Unable to build URI for created resource"
,
e
);
response
=
Response
.
ok
();
}
hallihallo2
.
addCreated
();
importSuccessful
=
true
;
}
else
if
(
stat
.
getStatus
()
==
Status
.
Updated
){
response
=
Response
.
ok
();
location
=
URI
.
create
(
"Binary/"
+
stat
.
getDocumentId
());
// Location header not allowed for status 200
hallihallo2
.
addUpdated
();
importSuccessful
=
true
;
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment