本文整理汇总了Java中ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum类的典型用法代码示例。如果您正苦于以下问题:Java AdministrativeGenderCodesEnum类的具体用法?Java AdministrativeGenderCodesEnum怎么用?Java AdministrativeGenderCodesEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AdministrativeGenderCodesEnum类属于ca.uhn.fhir.model.dstu.valueset包,在下文中一共展示了AdministrativeGenderCodesEnum类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetAllPopulatedChildElementsOfType
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
@Test
public void testGetAllPopulatedChildElementsOfType() {
Patient p = new Patient();
p.setGender(AdministrativeGenderCodesEnum.M);
p.addIdentifier().setSystem("urn:foo");
p.addAddress().addLine("Line1");
p.addAddress().addLine("Line2");
p.addName().addFamily("Line3");
FhirTerser t = new FhirContext().newTerser();
List<StringDt> strings = t.getAllPopulatedChildElementsOfType(p, StringDt.class);
assertEquals(3, strings.size());
assertThat(strings, containsInAnyOrder(new StringDt("Line1"), new StringDt("Line2"), new StringDt("Line3")));
}
示例2: PatientResourceProvider
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
/**
* Constructor, which pre-populates the provider with one resource instance.
*/
public PatientResourceProvider() {
long resourceId = myNextId++;
Patient patient = new Patient();
patient.setId(Long.toString(resourceId));
patient.addIdentifier();
patient.getIdentifier().get(0).setSystem(new UriDt("urn:hapitest:mrns"));
patient.getIdentifier().get(0).setValue("00002");
patient.addName().addFamily("Test");
patient.getName().get(0).addGiven("PatientOne");
patient.setGender(AdministrativeGenderCodesEnum.F);
LinkedList<Patient> list = new LinkedList<Patient>();
list.add(patient);
myIdToPatientVersions.put(resourceId, list);
}
示例3: main
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
public static void main(String[] theArgs) {
Patient pat = new Patient();
pat.addName().addFamily("Simpson").addGiven("Homer").addGiven("J");
pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135");
pat.setGender(AdministrativeGenderCodesEnum.M);
// Create a context
FhirContext ctx = new FhirContext();
// Create a client
String serverBaseUrl = "http://fhirtest.uhn.ca/base";
IGenericClient client = ctx.newRestfulGenericClient(serverBaseUrl);
// Use the client to store a new resource instance
MethodOutcome outcome = client.create().resource(pat).execute();
// Print the ID of the newly created resource
System.out.println(outcome.getId());
}
示例4: main
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
public static void main(String[] theArgs) {
// Create a Patient
Patient pat = new Patient();
pat.addName().addFamily("Simpson").addGiven("Homer").addGiven("J");
pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135");
pat.addIdentifier().setLabel("Library Card 12345").setValue("12345");
pat.addTelecom().setUse(ContactUseEnum.HOME).setSystem(ContactSystemEnum.PHONE).setValue("1 (416) 340-4800");
pat.setGender(AdministrativeGenderCodesEnum.M);
// Create a context
FhirContext ctx = new FhirContext();
// Create a XML parser
IParser parser = ctx.newXmlParser();
parser.setPrettyPrint(true);
String encode = parser.encodeResourceToString(pat);
System.out.println(encode);
}
示例5: main
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
public static void main(String[] theArgs) {
// Create a client
String serverBaseUrl = "http://fhirtest.uhn.ca/base";
FhirContext ctx = new FhirContext();
IGenericClient client = ctx.newRestfulGenericClient(serverBaseUrl);
// Use the client to read back the new instance using the
// ID we retrieved from the read
Patient patient = client.read(Patient.class, "4529");
// Print the ID of the newly created resource
System.out.println("Found ID: " + patient.getId());
// Change the gender and send an update to the server
patient.setGender(AdministrativeGenderCodesEnum.F);
MethodOutcome outcome = client.update().resource(patient).execute();
System.out.println("Now have ID: " + outcome.getId());
}
示例6: main
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
public static void main(String[] theArgs) {
Patient pat = new Patient();
pat.addName().addFamily("Simpson").addGiven("Homer").addGiven("J");
pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("7000135");
pat.addIdentifier().setLabel("Library Card 12345").setValue("12345");
// Enumerated types are provided for many coded elements
ContactDt contact = pat.addTelecom();
contact.setUse(ContactUseEnum.HOME);
contact.setSystem(ContactSystemEnum.PHONE);
contact.setValue("1 (416) 340-4800");
pat.setGender(AdministrativeGenderCodesEnum.M);
}
示例7: initPatient
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
private void initPatient() {
this.patient = new Patient();
this.patient.setId(new IdDt(UUID.randomUUID().toString()));
this.patient.addIdentifier().setSystem("http://example.com/fictitious-mrns").setValue("MRN001");
this.patient.setGender(AdministrativeGenderCodesEnum.M);
this.patient.addName().setUse(NameUseEnum.OFFICIAL).addFamily(this.patFamName1).addGiven(this.patGivName1);
}
示例8: testSubmitPatient
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
@Test
public void testSubmitPatient() {
Patient p = new Patient();
p.addIdentifier("urn:MultiFhirVersionTest", "testSubmitPatient01");
p.addUndeclaredExtension(false, "http://foo#ext1", new StringDt("The value"));
p.getGender().setValueAsEnum(AdministrativeGenderCodesEnum.M);
IdDt id = ourClientDstu1.create().resource(p).execute().getId();
// Read back as DSTU1
Patient patDstu1 = ourClientDstu1.read(Patient.class, id);
assertEquals("testSubmitPatient01", p.getIdentifierFirstRep().getValue().getValue());
assertEquals(1, patDstu1.getUndeclaredExtensionsByUrl("http://foo#ext1").size());
assertEquals("M", patDstu1.getGender().getCodingFirstRep().getCode().getValue());
// Read back as DEV
ca.uhn.fhir.model.dstu2.resource.Patient patDstu2;
patDstu2 = ourClientDstu2.read(ca.uhn.fhir.model.dstu2.resource.Patient.class, id);
assertEquals("testSubmitPatient01", p.getIdentifierFirstRep().getValue().getValue());
assertEquals(1, patDstu2.getUndeclaredExtensionsByUrl("http://foo#ext1").size());
assertEquals(null, patDstu2.getGender());
// Search using new bundle format
Bundle bundle = ourClientDstu2.search().forResource(ca.uhn.fhir.model.dstu2.resource.Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:MultiFhirVersionTest", "testSubmitPatient01")).encodedJson().execute();
patDstu2 = (ca.uhn.fhir.model.dstu2.resource.Patient) bundle.getEntries().get(0).getResource();
assertEquals("testSubmitPatient01", p.getIdentifierFirstRep().getValue().getValue());
assertEquals(1, patDstu2.getUndeclaredExtensionsByUrl("http://foo#ext1").size());
assertEquals(null, patDstu2.getGender());
}
示例9: getResourceById
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
/**
* The "@Read" annotation indicates that this method supports the
* read operation. Read operations should return a single resource
* instance.
*
* @param theId
* The read operation takes one parameter, which must be of type
* IdDt and must be annotated with the "@Read.IdParam" annotation.
* @return
* Returns a resource matching this identifier, or null if none exists.
*/
@Read()
public Patient getResourceById(@IdParam IdDt theId) throws Exception {
String patientId = theId.getIdPart();
byte[] res = rpcClient.call("GetPatient", "{\"method\": \"GetPatient\", \"params\": {\"id\": " + patientId + "}}");
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
FiviumPatient fiviumPatient = mapper.readValue(res, FiviumPatient.class);
res = rpcClient.call("GetEhrId", "{\"method\": \"GetEhrId\", \"params\": {\"MRN\": \"" + fiviumPatient.getMrn() + "\"}}");
RPCResultGetEhrId getEhrResult = mapper.readValue(res, RPCResultGetEhrId.class);
Patient patient = new Patient();
patient.addIdentifier();
patient.getIdentifier().get(0).setSystem(new UriDt("id"));
patient.getIdentifier().get(0).setValue(fiviumPatient.getId());
patient.addIdentifier();
patient.getIdentifier().get(1).setSystem(new UriDt("mrn"));
patient.getIdentifier().get(1).setValue(fiviumPatient.getMrn());
patient.addIdentifier();
patient.getIdentifier().get(2).setSystem(new UriDt("ehrId"));
patient.getIdentifier().get(2).setValue(getEhrResult.getEhrId());
Calendar dobCal = DatatypeConverter.parseDate(fiviumPatient.getDob());
patient.setBirthDate(dobCal.getTime(), TemporalPrecisionEnum.DAY);
patient.addName();
patient.getName().get(0).addGiven(fiviumPatient.getFirstname());
patient.getName().get(0).addFamily(fiviumPatient.getSurname());
patient.addContact();
patient.getContact().get(0).addTelecom();
patient.getContact().get(0).getTelecom().get(0).setSystem(ContactSystemEnum.PHONE);
patient.getContact().get(0).getTelecom().get(0).setValue(fiviumPatient.getPhone());
patient.addContact();
patient.getContact().get(1).addTelecom();
patient.getContact().get(1).getTelecom().get(0).setSystem(ContactSystemEnum.EMAIL);
patient.getContact().get(1).getTelecom().get(0).setValue(fiviumPatient.getEmail());
if (fiviumPatient.getGender().equals("FEMALE")) {
patient.setGender(AdministrativeGenderCodesEnum.F);
} else if (fiviumPatient.getGender().equals("MALE")) {
patient.setGender(AdministrativeGenderCodesEnum.M);
} else {
patient.setGender(AdministrativeGenderCodesEnum.UNK);
}
// private String tumorType;
// private String surgical;
return patient;
}
示例10: testEncodeBoundCode
import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; //导入依赖的package包/类
@Test
public void testEncodeBoundCode() {
Patient patient = new Patient();
patient.addAddress().setUse(AddressUseEnum.HOME);
patient.getGender().setValueAsEnum(AdministrativeGenderCodesEnum.M);
String val = ourCtx.newXmlParser().encodeResourceToString(patient);
ourLog.info(val);
}