Bring examples up to DSTU2 compatibility
This commit is contained in:
parent
e98eb4a154
commit
4b8092b12e
|
@ -21,7 +21,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-structures-dstu</artifactId>
|
||||
<artifactId>hapi-fhir-structures-dstu2</artifactId>
|
||||
<version>0.9-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -5,10 +5,10 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.rest.annotation.RequiredParam;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
import ca.uhn.fhir.rest.client.api.IRestfulClient;
|
||||
|
@ -57,7 +57,7 @@ public class CompleteExampleClient {
|
|||
Organization org = (Organization) managingRef.loadResource(client);
|
||||
|
||||
// Print organization name
|
||||
System.out.println(org.getName().getValue());
|
||||
System.out.println(org.getName());
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package example;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.api.Bundle;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.rest.annotation.RequiredParam;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
import ca.uhn.fhir.rest.server.IResourceProvider;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
|
||||
@SuppressWarnings(value= {"serial","unused"})
|
||||
@SuppressWarnings(value= {"serial"})
|
||||
public class ExampleProviders {
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package example;
|
|||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
|
|
@ -5,9 +5,9 @@ import java.util.List;
|
|||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.api.ExtensionDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
|
@ -21,7 +21,7 @@ public static void main(String[] args) throws DataFormatException, IOException {
|
|||
// START SNIPPET: resourceExtension
|
||||
// Create an example patient
|
||||
Patient patient = new Patient();
|
||||
patient.addIdentifier(IdentifierUseEnum.OFFICIAL, "urn:example", "7000135", null);
|
||||
patient.addIdentifier().setUse(IdentifierUseEnum.OFFICIAL).setSystem("urn:example").setValue("7000135");
|
||||
|
||||
// Create an extension
|
||||
ExtensionDt ext = new ExtensionDt();
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package example;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.dstu.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.NameUseEnum;
|
||||
import ca.uhn.fhir.model.primitive.CodeDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum;
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
import ca.uhn.fhir.parser.IParser;
|
||||
|
||||
|
@ -103,16 +101,14 @@ IParser parser = ctx.newXmlParser();
|
|||
Patient patient = parser.parseResource(Patient.class, msgString);
|
||||
|
||||
// The patient object has accessor methods to retrieve all of the
|
||||
// data which has been parsed into the instance. All of the
|
||||
// FHIR datatypes are represented by classes which end in "Dt".
|
||||
StringDt patientId = patient.getIdentifier().get(0).getValue();
|
||||
StringDt familyName = patient.getName().get(0).getFamily().get(0);
|
||||
CodeDt gender = patient.getGender().getCoding().get(0).getCode();
|
||||
// data which has been parsed into the instance.
|
||||
String patientId = patient.getIdentifier().get(0).getValue();
|
||||
String familyName = patient.getName().get(0).getFamily().get(0).getValue();
|
||||
String gender = patient.getGender();
|
||||
|
||||
// The various datatype classes have accessors called getValue()
|
||||
System.out.println(patientId.getValue()); // PRP1660
|
||||
System.out.println(familyName.getValue()); // Cardinal
|
||||
System.out.println(gender.getValue()); // M
|
||||
System.out.println(patientId); // PRP1660
|
||||
System.out.println(familyName); // Cardinal
|
||||
System.out.println(gender); // M
|
||||
//END SNIPPET: parseMsg
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
package example;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
|
||||
import ca.uhn.fhir.model.dstu.composite.CodingDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.PeriodDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.QuantityDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum;
|
||||
import ca.uhn.fhir.model.dstu2.composite.CodingDt;
|
||||
import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
|
||||
import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.MaritalStatusCodesEnum;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.model.primitive.InstantDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
|
@ -28,8 +30,8 @@ public class FhirDataModel {
|
|||
|
||||
// The InstantDt also lets you work with the instant as a Java Date
|
||||
// object or as a FHIR String.
|
||||
Date date = obs.getIssued().getValue(); // A date object
|
||||
String dateString = obs.getIssued().getValueAsString(); // "2014-03-08T12:59:58.068-05:00"
|
||||
Date date = obs.getIssuedElement().getValue(); // A date object
|
||||
String dateString = obs.getIssuedElement().getValueAsString(); // "2014-03-08T12:59:58.068-05:00"
|
||||
// END SNIPPET: datatypes
|
||||
|
||||
System.out.println(date);
|
||||
|
@ -47,31 +49,108 @@ public class FhirDataModel {
|
|||
// child elements.
|
||||
IdentifierDt identifierDt = observation.getIdentifier();
|
||||
PeriodDt periodDt = observation.getIdentifier().getPeriod();
|
||||
DateTimeDt activeDt = observation.getIdentifier().getPeriod().getStart();
|
||||
DateTimeDt activeDt = observation.getIdentifier().getPeriod().getStartElement();
|
||||
|
||||
// DateTimeDt is a FHIR primitive however, so the following will return
|
||||
// null
|
||||
// unless a value has been placed there.
|
||||
Date active = observation.getIdentifier().getPeriod().getStart().getValue();
|
||||
Date active = observation.getIdentifier().getPeriod().getStartElement().getValue();
|
||||
// END SNIPPET: nonNull
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void codes() {
|
||||
// START SNIPPET: codes
|
||||
Patient patient = new Patient();
|
||||
|
||||
// Coded types can naturally be set using plain Strings
|
||||
CodingDt genderCoding = patient.getGender().addCoding();
|
||||
genderCoding.setSystem("http://hl7.org/fhir/v3/AdministrativeGender");
|
||||
genderCoding.setCode("M");
|
||||
|
||||
// This is equivalent to the three statements above
|
||||
patient.setGender(AdministrativeGenderCodesEnum.M);
|
||||
// You can set this code using a String if you want. Note that
|
||||
// for "closed" valuesets (such as the one used for Patient.gender)
|
||||
// you must use one of the strings defined by the FHIR specification.
|
||||
// You must not define your own.
|
||||
patient.getGenderElement().setValue("male");
|
||||
|
||||
// HAPI also provides Java enumerated types which make it easier to
|
||||
// deal with coded values. This code achieves the exact same result
|
||||
// as the code above.
|
||||
patient.setGender(AdministrativeGenderEnum.MALE);
|
||||
|
||||
// You can also retrieve coded values the same way
|
||||
String genderString = patient.getGenderElement().getValueAsString();
|
||||
AdministrativeGenderEnum genderEnum = patient.getGenderElement().getValueAsEnum();
|
||||
|
||||
// The following is a shortcut to create
|
||||
patient.setMaritalStatus(MaritalStatusCodesEnum.M);
|
||||
// END SNIPPET: codes
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void codeableConcepts() {
|
||||
// START SNIPPET: codeableConcepts
|
||||
Patient patient = new Patient();
|
||||
|
||||
// Coded types can naturally be set using plain strings
|
||||
CodingDt statusCoding = patient.getMaritalStatus().addCoding();
|
||||
statusCoding.setSystem("http://hl7.org/fhir/v3/MaritalStatus");
|
||||
statusCoding.setCode("M");
|
||||
statusCoding.setDisplay("Married");
|
||||
|
||||
// You could add a second coding to the field if needed too. This
|
||||
// can be useful if you want to convey the concept using different
|
||||
// codesystems.
|
||||
CodingDt secondStatus = patient.getMaritalStatus().addCoding();
|
||||
secondStatus.setCode("H");
|
||||
secondStatus.setSystem("http://example.com#maritalStatus");
|
||||
secondStatus.setDisplay("Happily Married");
|
||||
|
||||
// CodeableConcept also has a text field meant to convey
|
||||
// a user readable version of the concepts it conveys.
|
||||
patient.getMaritalStatus().setText("Happily Married");
|
||||
|
||||
// There are also accessors for retrieving values
|
||||
String firstCode = patient.getMaritalStatus().getCoding().get(0).getCode();
|
||||
String secondCode = patient.getMaritalStatus().getCoding().get(1).getCode();
|
||||
// END SNIPPET: codeableConcepts
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void codeableConceptEnums() {
|
||||
// START SNIPPET: codeableConceptEnums
|
||||
Patient patient = new Patient();
|
||||
|
||||
// Set the CodeableConcept's first coding to use the code
|
||||
// and codesystem associated with the M value.
|
||||
patient.setMaritalStatus(MaritalStatusCodesEnum.M);
|
||||
|
||||
// If you need to set other fields (such as the display name) after
|
||||
// using the Enum type, you may still do so.
|
||||
patient.getMaritalStatus().getCodingFirstRep().setDisplay("Married");
|
||||
patient.getMaritalStatus().getCodingFirstRep().setPrimary(true);
|
||||
patient.getMaritalStatus().getCodingFirstRep().setVersion("1.0");
|
||||
|
||||
// You can use accessors to retrieve values from CodeableConcept fields
|
||||
|
||||
// Returns "M"
|
||||
String code = patient.getMaritalStatus().getCodingFirstRep().getCode();
|
||||
|
||||
// Returns "http://hl7.org/fhir/v3/MaritalStatus". This value was also
|
||||
// populated via the enum above.
|
||||
String codeSystem = patient.getMaritalStatus().getCodingFirstRep().getCode();
|
||||
|
||||
// In many cases, Enum types can be used to retrieve values as well. Note that
|
||||
// the setter takes a single type, but the getter returns a Set, because the
|
||||
// field can technicaly contain more than one code and codesystem. BE CAREFUL
|
||||
// when using this method however, as no Enum will be returned in the case
|
||||
// that the field contains only a code other than the ones defined by the Enum.
|
||||
Set<MaritalStatusCodesEnum> status = patient.getMaritalStatus().getValueAsEnum();
|
||||
// END SNIPPET: codeableConceptEnums
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
datatypes();
|
||||
|
||||
|
@ -88,8 +167,8 @@ public class FhirDataModel {
|
|||
observation.setValue(q);
|
||||
|
||||
// Set the reference range
|
||||
observation.getReferenceRangeFirstRep().setLow(100);
|
||||
observation.getReferenceRangeFirstRep().setHigh(200);
|
||||
observation.getReferenceRangeFirstRep().setLow(new QuantityDt(100));
|
||||
observation.getReferenceRangeFirstRep().setHigh(new QuantityDt(200));
|
||||
|
||||
// END SNIPPET: observation
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@ import ca.uhn.fhir.model.api.Bundle;
|
|||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.base.resource.BaseConformance;
|
||||
import ca.uhn.fhir.model.base.resource.BaseOperationOutcome;
|
||||
import ca.uhn.fhir.model.dstu.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.api.MethodOutcome;
|
||||
import ca.uhn.fhir.rest.client.IGenericClient;
|
||||
|
@ -47,7 +47,7 @@ public class GenericClientExample {
|
|||
// START SNIPPET: create
|
||||
Patient patient = new Patient();
|
||||
// ..populate the patient object..
|
||||
patient.addIdentifier("urn:system", "12345");
|
||||
patient.addIdentifier().setSystem("urn:system").setValue("12345");
|
||||
patient.addName().addFamily("Smith").addGiven("John");
|
||||
|
||||
// Invoke the server create method (and send pretty-printed JSON
|
||||
|
@ -72,7 +72,7 @@ public class GenericClientExample {
|
|||
// START SNIPPET: update
|
||||
Patient patient = new Patient();
|
||||
// ..populate the patient object..
|
||||
patient.addIdentifier("urn:system", "12345");
|
||||
patient.addIdentifier().setSystem("urn:system").setValue("12345");
|
||||
patient.addName().addFamily("Smith").addGiven("John");
|
||||
|
||||
// To update a resource, it should have an ID set (if the resource
|
||||
|
@ -106,7 +106,7 @@ public class GenericClientExample {
|
|||
System.out.println("Version ID: " + patient.getId().getVersionIdPart());
|
||||
|
||||
// Now let's make a change to the resource
|
||||
patient.setGender(AdministrativeGenderCodesEnum.F);
|
||||
patient.setGender(AdministrativeGenderEnum.FEMALE);
|
||||
|
||||
// Invoke the server update method - Because the resource has
|
||||
// a version, it will be included in the request sent to
|
||||
|
@ -147,7 +147,7 @@ public class GenericClientExample {
|
|||
Bundle response = client.search()
|
||||
.forResource(Patient.class)
|
||||
.where(Patient.BIRTHDATE.beforeOrEquals().day("2011-01-01"))
|
||||
.and(Patient.PROVIDER.hasChainedProperty(Organization.NAME.matches().value("Health")))
|
||||
.and(Patient.CAREPROVIDER.hasChainedProperty(Organization.NAME.matches().value("Health")))
|
||||
.execute();
|
||||
// END SNIPPET: search
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package example;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
|
|
|
@ -8,7 +8,7 @@ import ca.uhn.fhir.model.api.annotation.Child;
|
|||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Extension;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.util.ElementUtil;
|
||||
|
|
|
@ -10,7 +10,7 @@ import ca.uhn.fhir.model.api.annotation.Child;
|
|||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Extension;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
|
|
|
@ -3,8 +3,8 @@ package example;
|
|||
import java.io.IOException;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
|
||||
|
@ -14,7 +14,7 @@ public static void main(String[] args) throws DataFormatException, IOException {
|
|||
|
||||
//START SNIPPET: example1
|
||||
Patient patient = new Patient();
|
||||
patient.addIdentifier("urn:foo", "7000135");
|
||||
patient.addIdentifier().setSystem("urn:foo").setValue("7000135");
|
||||
patient.addName().addFamily("Smith").addGiven("John").addGiven("Edward");
|
||||
patient.addAddress().addLine("742 Evergreen Terrace").setCity("Springfield").setState("ZZ");
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package example;
|
|||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.InstantDt;
|
||||
import ca.uhn.fhir.rest.annotation.RequiredParam;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
|
@ -11,7 +11,7 @@ import ca.uhn.fhir.rest.param.StringParam;
|
|||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.IResourceProvider;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
//START SNIPPET: provider
|
||||
public class PagingPatientProvider implements IResourceProvider {
|
||||
|
||||
|
|
|
@ -1,17 +1,6 @@
|
|||
package example;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.InstantDt;
|
||||
import ca.uhn.fhir.rest.annotation.RequiredParam;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
import ca.uhn.fhir.rest.server.FifoMemoryPagingProvider;
|
||||
import ca.uhn.fhir.rest.server.IBundleProvider;
|
||||
import ca.uhn.fhir.rest.server.IPagingProvider;
|
||||
import ca.uhn.fhir.rest.server.IResourceProvider;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
|
||||
@SuppressWarnings({ "unused", "serial" })
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
package example;
|
||||
|
||||
import static ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum.OFFICIAL;
|
||||
import static ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum.SECONDARY;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum;
|
||||
import ca.uhn.fhir.model.dstu2.composite.IdentifierDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
import ca.uhn.fhir.rest.annotation.Create;
|
||||
import ca.uhn.fhir.rest.annotation.RequiredParam;
|
||||
|
@ -24,12 +23,12 @@ public class QuickUsage {
|
|||
public static void main(String[] args) throws DataFormatException, IOException {
|
||||
|
||||
Patient patient = new Patient();
|
||||
patient.addIdentifier().setUse(OFFICIAL).setSystem("urn:fake:mrns").setValue("7000135");
|
||||
patient.addIdentifier().setUse(SECONDARY).setSystem("urn:fake:otherids").setValue("3287486");
|
||||
patient.addIdentifier().setUse(IdentifierUseEnum.OFFICIAL).setSystem("urn:fake:mrns").setValue("7000135");
|
||||
patient.addIdentifier().setUse(IdentifierUseEnum.SECONDARY).setSystem("urn:fake:otherids").setValue("3287486");
|
||||
|
||||
patient.addName().addFamily("Smith").addGiven("John").addGiven("Q").addSuffix("Junior");
|
||||
|
||||
patient.setGender(AdministrativeGenderCodesEnum.M);
|
||||
patient.setGender(AdministrativeGenderEnum.MALE);
|
||||
|
||||
|
||||
FhirContext ctx = new FhirContext();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package example;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.dstu.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
|
||||
public class ResourceRefs {
|
||||
|
||||
|
@ -17,12 +17,12 @@ public class ResourceRefs {
|
|||
// Create an organization, and give it a local ID
|
||||
Organization org = new Organization();
|
||||
org.setId("#localOrganization");
|
||||
org.getName().setValue("Contained Test Organization");
|
||||
org.getNameElement().setValue("Contained Test Organization");
|
||||
|
||||
// Create a patient
|
||||
Patient patient = new Patient();
|
||||
patient.setId("Patient/1333");
|
||||
patient.addIdentifier("urn:mrns", "253345");
|
||||
patient.addIdentifier().setSystem("urn:mrns").setValue("253345");
|
||||
|
||||
// Set the reference, and manually add the contained resource
|
||||
patient.getManagingOrganization().setReference("#localOrganization");
|
||||
|
|
|
@ -3,9 +3,9 @@ package example;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.model.primitive.UriDt;
|
||||
|
@ -49,7 +49,7 @@ public class RestfulObservationResourceProvider implements IResourceProvider {
|
|||
patient.getIdentifier().get(0).setValue("00002");
|
||||
patient.addName().addFamily("Test");
|
||||
patient.getName().get(0).addGiven("PatientOne");
|
||||
patient.setGender(AdministrativeGenderCodesEnum.F);
|
||||
patient.setGender(AdministrativeGenderEnum.FEMALE);
|
||||
return patient;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class RestfulObservationResourceProvider implements IResourceProvider {
|
|||
patient.addName();
|
||||
patient.getName().get(0).addFamily("Test");
|
||||
patient.getName().get(0).addGiven("PatientOne");
|
||||
patient.getGender().setText("M");
|
||||
patient.setGender(AdministrativeGenderEnum.MALE);
|
||||
return Collections.singletonList(patient);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ package example;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.model.primitive.UriDt;
|
||||
|
@ -50,7 +50,7 @@ public class RestfulPatientResourceProvider implements IResourceProvider {
|
|||
patient.getIdentifier().get(0).setValue("00002");
|
||||
patient.addName().addFamily("Test");
|
||||
patient.getName().get(0).addGiven("PatientOne");
|
||||
patient.setGender(AdministrativeGenderCodesEnum.F);
|
||||
patient.setGender(AdministrativeGenderEnum.FEMALE);
|
||||
return patient;
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class RestfulPatientResourceProvider implements IResourceProvider {
|
|||
patient.addName();
|
||||
patient.getName().get(0).addFamily(theFamilyName.getValue());
|
||||
patient.getName().get(0).addGiven("PatientOne");
|
||||
patient.getGender().setText("M");
|
||||
patient.setGender(AdministrativeGenderEnum.MALE);
|
||||
return Collections.singletonList(patient);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package example;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -20,17 +19,15 @@ import ca.uhn.fhir.model.api.TagList;
|
|||
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.base.composite.BaseCodingDt;
|
||||
import ca.uhn.fhir.rest.annotation.TagListParam;
|
||||
import ca.uhn.fhir.model.dstu.composite.CodingDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Conformance;
|
||||
import ca.uhn.fhir.model.dstu.resource.DiagnosticReport;
|
||||
import ca.uhn.fhir.model.dstu.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu.resource.OperationOutcome;
|
||||
import ca.uhn.fhir.model.dstu.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum;
|
||||
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Conformance;
|
||||
import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.model.primitive.DecimalDt;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
|
@ -52,6 +49,7 @@ import ca.uhn.fhir.rest.annotation.ResourceParam;
|
|||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
import ca.uhn.fhir.rest.annotation.Since;
|
||||
import ca.uhn.fhir.rest.annotation.Sort;
|
||||
import ca.uhn.fhir.rest.annotation.TagListParam;
|
||||
import ca.uhn.fhir.rest.annotation.Transaction;
|
||||
import ca.uhn.fhir.rest.annotation.TransactionParam;
|
||||
import ca.uhn.fhir.rest.annotation.Update;
|
||||
|
@ -163,7 +161,7 @@ public List<Patient> findPatients(
|
|||
//START SNIPPET: referenceSimple
|
||||
@Search
|
||||
public List<Patient> findPatientsWithSimpleReference(
|
||||
@OptionalParam(name=Patient.SP_PROVIDER) ReferenceParam theProvider
|
||||
@OptionalParam(name=Patient.SP_CAREPROVIDER) ReferenceParam theProvider
|
||||
) {
|
||||
List<Patient> retVal=new ArrayList<Patient>();
|
||||
|
||||
|
|
|
@ -1,79 +1,13 @@
|
|||
package example;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.api.Bundle;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.api.Include;
|
||||
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
||||
import ca.uhn.fhir.model.api.Tag;
|
||||
import ca.uhn.fhir.model.api.TagList;
|
||||
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.rest.annotation.TagListParam;
|
||||
import ca.uhn.fhir.model.dstu.composite.CodingDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Conformance;
|
||||
import ca.uhn.fhir.model.dstu.resource.DiagnosticReport;
|
||||
import ca.uhn.fhir.model.dstu.resource.Observation;
|
||||
import ca.uhn.fhir.model.dstu.resource.OperationOutcome;
|
||||
import ca.uhn.fhir.model.dstu.resource.Organization;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum;
|
||||
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
|
||||
import ca.uhn.fhir.model.primitive.DecimalDt;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IssueSeverityEnum;
|
||||
import ca.uhn.fhir.model.dstu2.resource.OperationOutcome;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.model.primitive.InstantDt;
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
import ca.uhn.fhir.rest.annotation.AddTags;
|
||||
import ca.uhn.fhir.rest.annotation.Count;
|
||||
import ca.uhn.fhir.rest.annotation.Create;
|
||||
import ca.uhn.fhir.rest.annotation.DeleteTags;
|
||||
import ca.uhn.fhir.rest.annotation.GetTags;
|
||||
import ca.uhn.fhir.rest.annotation.History;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.IncludeParam;
|
||||
import ca.uhn.fhir.rest.annotation.Metadata;
|
||||
import ca.uhn.fhir.rest.annotation.OptionalParam;
|
||||
import ca.uhn.fhir.rest.annotation.Read;
|
||||
import ca.uhn.fhir.rest.annotation.RequiredParam;
|
||||
import ca.uhn.fhir.rest.annotation.ResourceParam;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
import ca.uhn.fhir.rest.annotation.Since;
|
||||
import ca.uhn.fhir.rest.annotation.Sort;
|
||||
import ca.uhn.fhir.rest.annotation.Transaction;
|
||||
import ca.uhn.fhir.rest.annotation.TransactionParam;
|
||||
import ca.uhn.fhir.rest.annotation.Update;
|
||||
import ca.uhn.fhir.rest.annotation.Validate;
|
||||
import ca.uhn.fhir.rest.api.MethodOutcome;
|
||||
import ca.uhn.fhir.rest.api.SortOrderEnum;
|
||||
import ca.uhn.fhir.rest.api.SortSpec;
|
||||
import ca.uhn.fhir.rest.client.api.IBasicClient;
|
||||
import ca.uhn.fhir.rest.client.api.IRestfulClient;
|
||||
import ca.uhn.fhir.rest.param.CompositeParam;
|
||||
import ca.uhn.fhir.rest.param.DateParam;
|
||||
import ca.uhn.fhir.rest.param.DateRangeParam;
|
||||
import ca.uhn.fhir.rest.param.QuantityParam;
|
||||
import ca.uhn.fhir.rest.param.ReferenceParam;
|
||||
import ca.uhn.fhir.rest.param.StringAndListParam;
|
||||
import ca.uhn.fhir.rest.param.StringOrListParam;
|
||||
import ca.uhn.fhir.rest.param.StringParam;
|
||||
import ca.uhn.fhir.rest.param.TokenOrListParam;
|
||||
import ca.uhn.fhir.rest.param.TokenParam;
|
||||
import ca.uhn.fhir.rest.server.IResourceProvider;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public abstract class ServerExceptionsExample implements IResourceProvider {
|
||||
|
|
|
@ -3,18 +3,14 @@ package example;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.api.ExtensionDt;
|
||||
import ca.uhn.fhir.model.dstu.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
|
||||
import ca.uhn.fhir.model.dstu2.composite.HumanNameDt;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.parser.DataFormatException;
|
||||
import ca.uhn.fhir.rest.server.interceptor.InterceptorAdapter;
|
||||
|
||||
public class ServerInterceptors {
|
||||
|
||||
|
@ -25,7 +21,7 @@ public static void main(String[] args) throws DataFormatException, IOException {
|
|||
// START SNIPPET: resourceExtension
|
||||
// Create an example patient
|
||||
Patient patient = new Patient();
|
||||
patient.addIdentifier(IdentifierUseEnum.OFFICIAL, "urn:example", "7000135", null);
|
||||
patient.addIdentifier().setUse(IdentifierUseEnum.OFFICIAL).setSystem("urn:example").setValue("7000135");
|
||||
|
||||
// Create an extension
|
||||
ExtensionDt ext = new ExtensionDt();
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
||||
import ca.uhn.fhir.model.api.Tag;
|
||||
import ca.uhn.fhir.model.api.TagList;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.primitive.InstantDt;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import ca.uhn.fhir.context.FhirContext;
|
|||
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
||||
import ca.uhn.fhir.model.api.Tag;
|
||||
import ca.uhn.fhir.model.api.TagList;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
import ca.uhn.fhir.rest.client.IGenericClient;
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ import org.apache.commons.io.filefilter.WildcardFileFilter;
|
|||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.dstu.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum;
|
||||
import ca.uhn.fhir.model.dstu2.resource.Patient;
|
||||
import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum;
|
||||
import ca.uhn.fhir.validation.FhirValidator;
|
||||
import ca.uhn.fhir.validation.ValidationResult;
|
||||
|
||||
|
@ -23,8 +23,8 @@ public class ValidatorExamples {
|
|||
// Create and populate a new patient object
|
||||
Patient p = new Patient();
|
||||
p.addName().addFamily("Smith").addGiven("John").addGiven("Q");
|
||||
p.addIdentifier("urn:foo:identifiers", "12345");
|
||||
p.addTelecom().setSystem(ContactSystemEnum.PHONE).setValue("416 123-4567");
|
||||
p.addIdentifier().setSystem("urn:foo:identifiers").setValue("12345");
|
||||
p.addTelecom().setSystem(ContactPointSystemEnum.PHONE).setValue("416 123-4567");
|
||||
|
||||
// Request a validator and apply it
|
||||
FhirValidator val = ctx.newValidator();
|
||||
|
|
|
@ -1,124 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd" name="HAPI">
|
||||
|
||||
<bannerLeft>
|
||||
<name>HAPI</name>
|
||||
<src>images/hapi_fhir_banner.png</src>
|
||||
<href>http://jamesagnew.github.io/hapi-fhir/</href>
|
||||
</bannerLeft>
|
||||
|
||||
<bannerRight>
|
||||
<name>FHIR</name>
|
||||
<src>images/hapi_fhir_banner_right.png</src>
|
||||
<href>http://jamesagnew.github.io/hapi-fhir/</href>
|
||||
</bannerRight>
|
||||
|
||||
<poweredBy>
|
||||
<logo name="Hosted on GitHub" href="https://github.com/jamesagnew/hapi-fhir" img="./images/github-logo-mini.png"/>
|
||||
<logo name="Built with Maven 3" href="http://maven.apache.org" img="./images/maven-logo-mini.png" />
|
||||
</poweredBy>
|
||||
|
||||
<version position="left" />
|
||||
|
||||
<body>
|
||||
<head>
|
||||
<!-- Syntax Highlighter -->
|
||||
<script type="text/javascript" src="syntaxhighlighter/shCore.js"></script>
|
||||
<script type="text/javascript" src="syntaxhighlighter/shBrushJScript.js"></script>
|
||||
<script type="text/javascript" src="syntaxhighlighter/shBrushJava.js"></script>
|
||||
<script type="text/javascript" src="syntaxhighlighter/shBrushBash.js"></script>
|
||||
<script type="text/javascript" src="syntaxhighlighter/shBrushXml.js"></script>
|
||||
<link href="syntaxhighlighter/shCore.css" rel="stylesheet" type="text/css" />
|
||||
<link href="syntaxhighlighter/shThemeDefault.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!--
|
||||
HAPI stylesheet comes after because it overwrites the Syntax Highlighter
|
||||
font size
|
||||
-->
|
||||
<link rel="shortcut icon" href="https://github.com/jamesagnew/hapi-fhir/images/favicon.png" />
|
||||
<link rel="stylesheet" type="text/css" href="hapi.css" />
|
||||
</head>
|
||||
|
||||
<links>
|
||||
<item name="GitHub Page" href="https://github.com/jamesagnew/hapi-fhir/" />
|
||||
<item name="hl7.org" href="http://hl7.org/" />
|
||||
<item name="University Health Network" href="http://www.uhn.ca/" />
|
||||
</links>
|
||||
|
||||
<menu name="Welcome">
|
||||
<item name="Welcome" href="index.html" />
|
||||
<item name="Download" href="./download.html" />
|
||||
<item name="Upgrade Guide" href="./doc_upgrading.html" />
|
||||
<item name="Changelog" href="./changes-report.html" />
|
||||
</menu>
|
||||
|
||||
<menu name="Test Server">
|
||||
<item name="Public Test Server" href="http://fhirtest.uhn.ca"/>
|
||||
<item name="Vagrant (Private) Test Server" href="doc_vagrant.html"/>
|
||||
</menu>
|
||||
|
||||
<menu name="Documentation">
|
||||
<item name="Introduction" href="./doc_intro.html" />
|
||||
<item name="The Data Model" href="./doc_fhirobjects.html">
|
||||
<item name="Profiles & Extensions" href="./doc_extensions.html" />
|
||||
<item name="Resource References" href="./doc_resource_references.html" />
|
||||
<item name="Tags" href="./doc_tags.html" />
|
||||
<item name="Validation" href="./doc_validation.html" />
|
||||
</item>
|
||||
<item name="RESTful Client" href="./doc_rest_client.html" >
|
||||
<item name="Interceptors (client)" href="./doc_rest_client_interceptor.html"/>
|
||||
</item>
|
||||
<item name="RESTful Server" href="./doc_rest_server.html" >
|
||||
<item name="RESTful Operations" href="./doc_rest_operations.html" />
|
||||
<item name="Narrative Generator" href="./doc_narrative.html" />
|
||||
<item name="CORS Support" href="./doc_cors.html" />
|
||||
<item name="Interceptors (server)" href="./doc_rest_server_interceptor.html" />
|
||||
<item name="Web Testing UI" href="./doc_server_tester.html" />
|
||||
</item>
|
||||
<item name="Logging" href="./doc_logging.html" />
|
||||
<item name="Tinder Plugin" href="./doc_tinder.html" />
|
||||
</menu>
|
||||
|
||||
<menu name="Community">
|
||||
<item name="Google Group" href="https://groups.google.com/d/forum/hapi-fhir" />
|
||||
<item name="Issue Tracker" href="https://github.com/jamesagnew/hapi-fhir/issues" />
|
||||
</menu>
|
||||
|
||||
<menu name="JavaDocs">
|
||||
<<<<<<< HEAD:src/site/site.xml
|
||||
<item name="API (Core)" href="./apidocs/index.html" />
|
||||
<item name="API (DSTU Model)" href="./apidocs-dstu/index.html" />
|
||||
<item name="API (DEV Model)" href="./apidocs-dev/index.html" />
|
||||
=======
|
||||
<item name="Core API" href="./apidocs/index.html" />
|
||||
<item name="Model API (DSTU1)" href="./apidocs-dstu/index.html" />
|
||||
<item name="Model API (DEV)" href="./apidocs-dev/index.html" />
|
||||
>>>>>>> d22a35788f57e9f7ce64bc8afc2ee7eaf29d94f2:src/site/site.xml
|
||||
<item name="Source Code" href=".https://github.com/jamesagnew/hapi-fhir" />
|
||||
</menu>
|
||||
|
||||
<menu name="Reports">
|
||||
<item name="Developers" href="team-list.html" />
|
||||
<item name="Unit Test Report" href="surefire-report.html" />
|
||||
<item name="FindBugs" href="findbugs.html" />
|
||||
<item name="License" href="license.html" />
|
||||
<item name="Source Code" href="https://github.com/jamesagnew/hapi-fhir" />
|
||||
</menu>
|
||||
|
||||
</body>
|
||||
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</skin>
|
||||
|
||||
<custom>
|
||||
<fluidoSkin>
|
||||
<googleSearch />
|
||||
<!-- <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled> -->
|
||||
</fluidoSkin>
|
||||
</custom>
|
||||
|
||||
</project>
|
||||
|
|
@ -56,11 +56,18 @@
|
|||
There are many places in the FHIR specification where a "coded" string is
|
||||
used. This means that a code must be chosen from a list of allowable values.
|
||||
</p>
|
||||
|
||||
|
||||
<h4>Closed Valuesets / Codes</h4>
|
||||
|
||||
<p>
|
||||
In these cases, HAPI tries to simplify the process by providing Java Enum
|
||||
types, which can be used to reduce complexity and provide compile-time
|
||||
checking.
|
||||
The FHIR specification defines a number of "closed" ValueSets, such as
|
||||
the one used for
|
||||
<!-- TODO: replace the link below with a non GitHub link once DSTU2 is balloted -->
|
||||
<a href="http://hl7-fhir.github.io/administrative-gender.html">Patient.gender</a>
|
||||
(<i>note that this field was not a closed ValueSet in DSTU1 but is as of DSTU2</i>).
|
||||
These valuesets must either be empty, or be populated with a value drawn from
|
||||
the list of allowable values defined by FHIR. HAPI provides special typesafe
|
||||
Enums to help in dealing with these fields.
|
||||
</p>
|
||||
|
||||
<macro name="snippet">
|
||||
|
@ -68,6 +75,42 @@
|
|||
<param name="file" value="examples/src/main/java/example/FhirDataModel.java" />
|
||||
</macro>
|
||||
|
||||
<h4>Open Valusets / CodeableConcepts</h4>
|
||||
|
||||
<p>
|
||||
The FHIR specification also defines a number of "open" ValueSets, such as
|
||||
the one used for
|
||||
<a href="http://hl7.org/implement/standards/fhir/valueset-marital-status.html">Patient.maritalStatus</a>.
|
||||
These fields may define a set of allowable codes, but also allow you to
|
||||
use your own codes instead if none of the given codes matches your needs. This
|
||||
is called an <a href="http://hl7.org/implement/standards/fhir/terminologies.html#incomplete">incomplete binding</a>.
|
||||
Some fields may even define a set of codes that serve as nothing more than
|
||||
an example as to the type of codes that would be used there. This is known as
|
||||
an <a href="http://hl7.org/implement/standards/fhir/terminologies.html#example">example binding</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For these fields, a CodeableConcept datatype is generally used by the
|
||||
FHIR specification. This datatype allows multiple "codings", which
|
||||
are a code and codesystem pair, optionally with a display name as well.
|
||||
The following example shows how to interact with this type.
|
||||
</p>
|
||||
|
||||
<macro name="snippet">
|
||||
<param name="id" value="codeableConcepts" />
|
||||
<param name="file" value="examples/src/main/java/example/FhirDataModel.java" />
|
||||
</macro>
|
||||
|
||||
<p>
|
||||
HAPI also provides typesafe enums to help in working with CodeableConcept
|
||||
fields.
|
||||
</p>
|
||||
|
||||
<macro name="snippet">
|
||||
<param name="id" value="codeableConceptEnums" />
|
||||
<param name="file" value="examples/src/main/java/example/FhirDataModel.java" />
|
||||
</macro>
|
||||
|
||||
</subsection>
|
||||
|
||||
<subsection name="Convenience Methods">
|
||||
|
|
Loading…
Reference in New Issue