diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java index bae04ff9d5f..9ba03b3a188 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java @@ -354,7 +354,7 @@ public class MethodUtil { } /* - * Note: for the frst two here, we're using strings instead of static binding + * Note: for the first two here, we're using strings instead of static binding * so that we don't need the java.servlet JAR on the classpath in order to use * this class */ diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java index 1f137b04bbb..fde0be65c63 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java @@ -165,6 +165,16 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test { } return retVal; } + + @Test + public void testResourceSorting() throws Exception { + String input = IOUtils.toString(getClass().getResourceAsStream("/two_questionnaires.json"), StandardCharsets.UTF_8); + String respString = ourClient.transaction().withBundle(input).prettyPrint().execute(); + ourLog.info(respString); + + ourHttpClient.execute(new HttpGet("http://localhost:" + ourPort + "/QuestionnaireResponse?patient=QR3295&questionnaire=profile&_sort:desc=authored&_count=5&_include=QuestionnaireResponse:questionnaire&_include=QuestionnaireResponse:subject")); +// Bundle bundle = + } /** * See #484 diff --git a/hapi-fhir-jpaserver-base/src/test/resources/two_questionnaires.json b/hapi-fhir-jpaserver-base/src/test/resources/two_questionnaires.json new file mode 100644 index 00000000000..d88500b8c5f --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/two_questionnaires.json @@ -0,0 +1,722 @@ +{ + "resourceType": "Bundle", + "id": "c52bd41e-5e0a-45fc-877a-6e245e638871", + "meta": { + "lastUpdated": "2016-11-07T16:50:40.867-05:00" + }, + "type": "transaction", + "total": 8, + "entry": [ + { + "fullUrl": "QuestionnaireResponse/QR3301", + "resource": { + "resourceType": "QuestionnaireResponse", + "id": "QR3301", + "meta": { + "versionId": "1", + "lastUpdated": "2016-11-04T17:22:43.970-04:00" + }, + "questionnaire": { + "reference": "Questionnaire/profile" + }, + "subject": { + "reference": "Patient/PT3295" + }, + "authored": "2016-11-04T17:21:06-04:00", + "group": { + "group": [ + { + "linkId": "basic", + "question": [ + { + "linkId": "schoolType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/schooltype", + "code": "PT" + } + } + ] + }, + { + "linkId": "workType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/worktype", + "code": "PT" + } + } + ] + } + ] + } + ] + } + }, + "request": { + "method": "PUT", "url": "QuestionnaireResponse/QR3301" + } + }, + { + "fullUrl": "QuestionnaireResponse/QR3300", + "resource": { + "resourceType": "QuestionnaireResponse", + "id": "QR3300", + "meta": { + "versionId": "1", + "lastUpdated": "2016-11-04T17:22:43.970-04:00" + }, + "questionnaire": { + "reference": "Questionnaire/profile" + }, + "subject": { + "reference": "Patient/PT3295" + }, + "authored": "2016-11-04T17:21:51-04:00", + "group": { + "group": [ + { + "linkId": "basic", + "question": [ + { + "linkId": "schoolType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/schooltype", + "code": "PT" + } + } + ] + }, + { + "linkId": "workType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/worktype", + "code": "PT" + } + } + ] + } + ] + }, + { + "linkId": "painArea", + "question": [ + { + "linkId": "name", + "answer": [ + { + "valueString": "RIGHT THIGH" + } + ] + }, + { + "linkId": "painLocations", + "answer": [ + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "209570001" + } + } + ] + }, + { + "linkId": "painQualities", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "ACHING" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "FREEZING" + } + } + ] + }, + { + "linkId": "painTriggers", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "ANXIETY" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "CERTAIN_FOODS" + } + } + ] + } + ] + } + ] + } + }, + "request": { + "method": "PUT", "url": "QuestionnaireResponse/QR3300" + } + }, + { + "fullUrl": "QuestionnaireResponse/QR3299", + "resource": { + "resourceType": "QuestionnaireResponse", + "id": "PT3299", + "meta": { + "versionId": "1", + "lastUpdated": "2016-11-04T17:22:43.970-04:00" + }, + "questionnaire": { + "reference": "Questionnaire/profile" + }, + "subject": { + "reference": "Patient/PT3295" + }, + "authored": "2016-11-04T17:22:07-04:00", + "group": { + "group": [ + { + "linkId": "basic", + "question": [ + { + "linkId": "schoolType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/schooltype", + "code": "PT" + } + } + ] + }, + { + "linkId": "workType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/worktype", + "code": "PT" + } + } + ] + } + ] + }, + { + "linkId": "painArea", + "question": [ + { + "linkId": "name", + "answer": [ + { + "valueString": "AREA 2233" + } + ] + }, + { + "linkId": "painLocations", + "answer": [ + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "302553009" + } + }, + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "51185008" + } + }, + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "368107006" + } + } + ] + }, + { + "linkId": "painQualities", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "SHOOTING" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "SPLITTING" + } + } + ] + }, + { + "linkId": "painTriggers", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "TOO_MUCH_DOWNTIME" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "TOO_MUCH_PHYSICAL_ACTIVITY" + } + } + ] + } + ] + }, + { + "linkId": "painArea", + "question": [ + { + "linkId": "name", + "answer": [ + { + "valueString": "RIGHT THIGH" + } + ] + }, + { + "linkId": "painLocations", + "answer": [ + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "209570001" + } + } + ] + }, + { + "linkId": "painQualities", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "ACHING" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "FREEZING" + } + } + ] + }, + { + "linkId": "painTriggers", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "ANXIETY" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "CERTAIN_FOODS" + } + } + ] + } + ] + } + ] + } + }, + "request": { + "method": "PUT", "url": "QuestionnaireResponse/QR3299" + } + }, + { + "fullUrl": "QuestionnaireResponse/QR3298", + "resource": { + "resourceType": "QuestionnaireResponse", + "id": "PT3298", + "meta": { + "versionId": "1", + "lastUpdated": "2016-11-04T17:22:43.970-04:00" + }, + "questionnaire": { + "reference": "Questionnaire/profile" + }, + "subject": { + "reference": "Patient/PT3295" + }, + "authored": "2016-11-04T17:22:26-04:00", + "group": { + "group": [ + { + "linkId": "basic", + "question": [ + { + "linkId": "schoolType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/schooltype", + "code": "PT" + } + } + ] + }, + { + "linkId": "workType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/worktype", + "code": "PT" + } + } + ] + } + ] + }, + { + "linkId": "painArea", + "question": [ + { + "linkId": "name", + "answer": [ + { + "valueString": "RIGHT THIGH" + } + ] + }, + { + "linkId": "painLocations", + "answer": [ + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "209570001" + } + } + ] + }, + { + "linkId": "painQualities", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "ACHING" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "FREEZING" + } + } + ] + }, + { + "linkId": "painTriggers", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "ANXIETY" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "CERTAIN_FOODS" + } + } + ] + } + ] + }, + { + "linkId": "painArea", + "question": [ + { + "linkId": "name", + "answer": [ + { + "valueString": "AREA 2233" + } + ] + }, + { + "linkId": "painLocations", + "answer": [ + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "302553009" + } + }, + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "51185008" + } + }, + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "368107006" + } + } + ] + }, + { + "linkId": "painQualities", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "SHOOTING" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/painquality", + "code": "SPLITTING" + } + } + ] + }, + { + "linkId": "painTriggers", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "TOO_MUCH_DOWNTIME" + } + }, + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/paintriggers", + "code": "TOO_MUCH_PHYSICAL_ACTIVITY" + } + } + ] + } + ] + } + ] + } + }, + "request": { + "method": "PUT", "url": "QuestionnaireResponse/QR3298" + } + }, + { + "fullUrl": "QuestionnaireResponse/QR3297", + "resource": { + "resourceType": "QuestionnaireResponse", + "id": "PT3297", + "meta": { + "versionId": "1", + "lastUpdated": "2016-11-04T17:22:43.970-04:00" + }, + "questionnaire": { + "reference": "Questionnaire/profile" + }, + "subject": { + "reference": "Patient/PT3295" + }, + "authored": "2016-11-04T17:22:41-04:00", + "group": { + "group": [ + { + "linkId": "basic", + "question": [ + { + "linkId": "inflammationLocations", + "answer": [ + { + "valueCoding": { + "system": "http://snomed.info/sct", + "code": "210659002" + } + } + ] + }, + { + "linkId": "schoolType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/schooltype", + "code": "PT" + } + } + ] + }, + { + "linkId": "workType", + "answer": [ + { + "valueCoding": { + "system": "http://ehealthinnovation.org/icc/ns/worktype", + "code": "PT" + } + } + ] + } + ] + } + ] + } + }, + "request": { + "method": "PUT", "url": "QuestionnaireResponse/PT3297" + } + }, + { + "fullUrl": "https://example.com/icc-server/fhir/Questionnaire/profile", + "resource": { + "resourceType": "Questionnaire", + "id": "profile", + "meta": { + "versionId": "1", + "lastUpdated": "2016-10-28T10:06:59.083-04:00" + }, + "group": { + "group": [ + { + "linkId": "basic", + "question": [ + { + "linkId": "schoolType", + "type": "choice", + "required": true, + "options": { + "reference": "ValueSet/schooltype" + } + }, + { + "linkId": "workType", + "type": "choice", + "required": true, + "options": { + "reference": "ValueSet/worktype" + } + }, + { + "linkId": "inflammationLocations", + "type": "choice", + "required": false, + "repeats": true, + "options": { + "reference": "ValueSet/painLocation" + } + } + ] + }, + { + "linkId": "painArea", + "required": true, + "repeats": true, + "question": [ + { + "linkId": "name", + "type": "string", + "required": false, + "repeats": false + }, + { + "linkId": "painLocations", + "type": "choice", + "required": true, + "repeats": true, + "options": { + "reference": "ValueSet/painLocation" + } + }, + { + "linkId": "painQualities", + "type": "open-choice", + "required": true, + "repeats": true, + "options": { + "reference": "ValueSet/painQuality" + } + }, + { + "linkId": "painTriggers", + "type": "open-choice", + "required": true, + "repeats": true, + "options": { + "reference": "ValueSet/painTriggers" + } + } + ] + } + ] + } + }, + "request": { + "method": "PUT", "url": "Questionnaire/profile" + } + }, + { + "fullUrl": "https://example.com/icc-server/fhir/Patient/PT3295", + "resource": { + "resourceType": "Patient", + "id": "PT3295", + "meta": { + "versionId": "5", + "lastUpdated": "2016-11-07T16:12:56.970-05:00" + }, + "name": [ + { + "use": "nickname", + "given": [ + "akib" + ] + }, + { + "use": "anonymous" + } + ], + "telecom": [ + { + "system": "email" + } + ], + "gender": "male", + "birthDate": "2013", + "photo": [ + { + "contentType": "image/jpeg", + "url": "https://example.com/icc-server/api/users/1431/avatar?version=2" + } + ] + }, + "request": { + "method": "PUT", "url": "Patient/PT3295" + } + } + ] +} \ No newline at end of file diff --git a/src/site/fml/hapi-fhir-faq.fml b/src/site/fml/hapi-fhir-faq.fml index 2bcd04240d9..a67b9fc478a 100644 --- a/src/site/fml/hapi-fhir-faq.fml +++ b/src/site/fml/hapi-fhir-faq.fml @@ -12,13 +12,32 @@ the HAPI FHIR Google Group. This group is a great resource, with lots of helpful people who can assist. The HAPI FHIR developers are regular contributors to this group. +
++ Please do not email us at our personal email addressees with questions about how to use HAPI! + We are much more likely to respond if you post your question in the group, since there are + a fixed number of hours in the day and we prefer to help in a place that benefits + everyone. Also, please do not post a question on the GitHub Issue Tracker + unless you are sure it is actually a bug. If you're not sure whether you have a question or a bug, + please post your question on the Google Group.
If you have questions which are about FHIR itself (e.g. which resource should - I use for a specific purpose, how to I model my data, etc.) you might want - to also consider posting on Stackoverflow, - as there are a number of FHIR experts who aren't HAPI/Java users who monitor - that site. + I use for a specific purpose, how to I model my data, etc.) + there are two great resources that can help you: +