本文整理汇总了Java中ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt类的典型用法代码示例。如果您正苦于以下问题:Java CodeableConceptDt类的具体用法?Java CodeableConceptDt怎么用?Java CodeableConceptDt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CodeableConceptDt类属于ca.uhn.fhir.model.dstu2.composite包,在下文中一共展示了CodeableConceptDt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapCodeToCodeableConcept
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
/**
* Helper function to convert a Code into a CodeableConceptDt. Takes an optional system, which
* replaces the Code.system in the resulting CodeableConceptDt if not null.
*
* @param from
* The Code to create a CodeableConcept from.
* @param system
* The system identifier, such as a URI. Optional; may be null.
* @return The converted CodeableConcept
*/
private static CodeableConceptDt mapCodeToCodeableConcept(Code from, String system) {
CodeableConceptDt to = new CodeableConceptDt();
if (from.display != null) {
to.setText(from.display);
}
CodingDt coding = new CodingDt();
coding.setCode(from.code);
coding.setDisplay(from.display);
if (system == null) {
coding.setSystem(from.system);
} else {
coding.setSystem(system);
}
to.addCoding(coding);
return to;
}
示例2: nonNull
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@SuppressWarnings("unused")
public void nonNull() {
// START SNIPPET: nonNull
Observation observation = new Observation();
// None of these calls will not return null, but instead create their
// respective
// child elements.
List<IdentifierDt> identifierList = observation.getIdentifier();
CodeableConceptDt code = observation.getCode();
StringDt textElement = observation.getCode().getTextElement();
// DateTimeDt is a FHIR primitive however, so the following will return
// null
// unless a value has been placed there.
Date active = observation.addIdentifier().getPeriod().getStartElement().getValue();
// END SNIPPET: nonNull
}
示例3: sendObservation
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private Observation sendObservation(String code, String system) throws InterruptedException {
Observation observation = new Observation();
CodeableConceptDt codeableConcept = new CodeableConceptDt();
observation.setCode(codeableConcept);
CodingDt coding = codeableConcept.addCoding();
coding.setCode(code);
coding.setSystem(system);
observation.setStatus(ObservationStatusEnum.FINAL);
MethodOutcome methodOutcome = ourClient.create().resource(observation).execute();
String observationId = methodOutcome.getId().getIdPart();
observation.setId(observationId);
waitForQueueToDrain();
return observation;
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:19,代码来源:RestHookTestWithInterceptorRegisteredToDaoConfigDstu2Test.java
示例4: createObservation
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void createObservation() throws Exception {
Observation observation = new Observation();
CodeableConceptDt cc = new CodeableConceptDt();
observation.setCode(cc);
CodingDt coding = cc.addCoding();
coding.setCode("82313006");
coding.setSystem("SNOMED-CT");
ResourceReferenceDt reference = new ResourceReferenceDt();
reference.setReference("Patient/" + myPatientId);
observation.setSubject(reference);
observation.setStatus(ObservationStatusEnum.FINAL);
MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
String observationId = methodOutcome2.getId().getIdPart();
observation.setId(observationId);
ourLog.info("Observation id generated by server is: " + observationId);
ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
waitForSize(2, mySocketImplementation.getMessages());
assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId, "ping " + mySubscriptionId));
}
示例5: createObservationThatDoesNotMatch
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void createObservationThatDoesNotMatch() throws Exception {
Observation observation = new Observation();
CodeableConceptDt cc = new CodeableConceptDt();
observation.setCode(cc);
CodingDt coding = cc.addCoding();
coding.setCode("8231");
coding.setSystem("SNOMED-CT");
ResourceReferenceDt reference = new ResourceReferenceDt();
reference.setReference("Patient/" + myPatientId);
observation.setSubject(reference);
observation.setStatus(ObservationStatusEnum.FINAL);
MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
String observationId = methodOutcome2.getId().getIdPart();
observation.setId(observationId);
ourLog.info("Observation id generated by server is: " + observationId);
waitForSize(2, mySocketImplementation.getMessages());
ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId));
}
示例6: sendObservation
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private Observation sendObservation(String code, String system) {
Observation observation = new Observation();
CodeableConceptDt codeableConcept = new CodeableConceptDt();
observation.setCode(codeableConcept);
CodingDt coding = codeableConcept.addCoding();
coding.setCode(code);
coding.setSystem(system);
observation.setStatus(ObservationStatusEnum.FINAL);
MethodOutcome methodOutcome = ourClient.create().resource(observation).execute();
String observationId = methodOutcome.getId().getIdPart();
observation.setId(observationId);
return observation;
}
示例7: createObservationThatDoesNotMatch
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void createObservationThatDoesNotMatch() throws Exception {
Observation observation = new Observation();
CodeableConceptDt cc = new CodeableConceptDt();
observation.setCode(cc);
CodingDt coding = cc.addCoding();
coding.setCode("8231");
coding.setSystem("SNOMED-CT");
ResourceReferenceDt reference = new ResourceReferenceDt();
reference.setReference("Patient/" + myPatientId);
observation.setSubject(reference);
observation.setStatus(ObservationStatusEnum.FINAL);
MethodOutcome methodOutcome2 = ourClient.create().resource(observation).execute();
String observationId = methodOutcome2.getId().getIdPart();
observation.setId(observationId);
ourLog.info("Observation id generated by server is: " + observationId);
ourLog.info("WS Messages: {}", mySocketImplementation.getMessages());
waitForSize(1, mySocketImplementation.getMessages());
assertThat(mySocketImplementation.getMessages(), contains("bound " + mySubscriptionId));
}
示例8: testCD2CodeableConcept
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void testCD2CodeableConcept() {
// simple instance test
CD cd = DatatypesFactory.eINSTANCE.createCD();
cd.setCode("code");
cd.setCodeSystem("codeSystem");
cd.setCodeSystemVersion("codeSystemVersion");
cd.setDisplayName("displayName");
CodeableConceptDt codeableConcept = dtt.tCD2CodeableConcept(cd);
Assert.assertEquals("CD.code transformation failed", "code", codeableConcept.getCoding().get(0).getCode());
Assert.assertEquals("CD.codeSystem transformation failed", "urn:oid:codeSystem", codeableConcept.getCoding().get(0).getSystem());
Assert.assertEquals("CD.codeSystemVersion transformation failed", "codeSystemVersion", codeableConcept.getCoding().get(0).getVersion());
Assert.assertEquals("CD.displayName transformation failed", "displayName", codeableConcept.getCoding().get(0).getDisplay());
// null instance test
CD cd2 = null;
CodeableConceptDt codeableConcept2 = dtt.tCD2CodeableConcept( cd2 );
Assert.assertNull("CD null instance transform failed", codeableConcept2);
// nullFlavor instance test
CD cd3 = DatatypesFactory.eINSTANCE.createCD();
cd3.setNullFlavor(NullFlavor.NI);
CodeableConceptDt codeableConcept3 = dtt.tCD2CodeableConcept( cd3 );
Assert.assertNull("CodeableConcept.nullFlavor set instance transform failed", codeableConcept3);
}
示例9: resolveReturnType
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
protected Class resolveReturnType(Class clazz, Object target, String path) {
if (target instanceof PeriodDt) {
if (path.equals("start") || path.equals("end")) {
return DateTimeDt.class;
}
}
else if (target instanceof QuantityDt) {
if (path.equals("value")) {
return DecimalDt.class;
}
else if (path.equals("unit")) {
return StringDt.class;
}
}
else if (target instanceof CodingDt) {
if (path.equals("code")) {
return CodeDt.class;
}
else if (path.equals("system")) {
return UriDt.class;
}
else if (path.equals("version") || path.equals("display")) {
return StringDt.class;
}
}
else if (target instanceof CodeableConceptDt) {
if (path.equals("text")) {
return StringDt.class;
}
}
return clazz;
}
示例10: resolveMedicationRequest
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
public static MedicationRequest resolveMedicationRequest(MedicationOrder order) throws FHIRException {
/*
* Required fields:
* MedicationOrder -> MedicationRequest
* medication -> medication
* dosageInstruction (Backbone) -> Dosage (Element)
*/
return new MedicationRequest()
.setStatus(MedicationRequest.MedicationRequestStatus.fromCode(order.getStatus()))
.setMedication(convertToCodeableConcept((CodeableConceptDt) order.getMedication()))
.setDosageInstruction(convertToDosage(order.getDosageInstruction()));
}
示例11: convertToCodeableConcept
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private static CodeableConcept convertToCodeableConcept(CodeableConceptDt conceptDt) {
CodeableConcept concept = new CodeableConcept().setText(conceptDt.getText() == null ? "" : conceptDt.getText());
concept.setId(conceptDt.getElementSpecificId());
List<Coding> codes = new ArrayList<>();
for (CodingDt code : conceptDt.getCoding()) {
codes.add(new Coding()
.setCode(code.getCode())
.setSystem(code.getSystem())
.setDisplay(code.getDisplay())
.setVersion(code.getVersion())
);
}
return concept.setCoding(codes);
}
示例12: testUpdateLoop
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
@Test
public void testUpdateLoop() {
Assert.assertNotNull(kSession);
System.out.println(" ---- Starting testUpdateLoop() Test ---");
Patient patient = (Patient) new Patient().setId("Patient/1");
RiskAssessment riskAssessment = (RiskAssessment) new RiskAssessment().setId("RiskAssessment/1");
Observation smokerObservation = (Observation) new Observation()
.setCode(new CodeableConceptDt("http://snomed.info/sct", "428041000124106"))
.setId("Observation/1");
Observation bodyMassIndexObservation = (Observation) new Observation()
.setCode(new CodeableConceptDt("http://snomed.info/sct", "60621009"))
.setValue(new IntegerDt(45))
.setId("Observation/2");
kSession.insert(patient);
kSession.insert(riskAssessment);
kSession.insert(smokerObservation);
kSession.insert(bodyMassIndexObservation);
Assert.assertEquals(15, kSession.fireAllRules(15));
System.out.println(" ---- Finished testUpdateLoop() Test ---");
}
示例13: createSnomedConditions
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private List<Condition> createSnomedConditions(int number, Patient patient) {
List<Condition> conditions = new ArrayList<>();
for (int i = 0; i < number; i++) {
String code = null;
switch (random.nextInt(3)) {
case 0:
code = "195967001"; //Asthma (disorder)
break;
case 1:
code = "73211009"; //Diabetes mellitus (disorder)
break;
case 2:
code = "8098009"; //Sexually transmitted infectious disease (disorder)
break;
}
conditions.add((Condition) new Condition()
.setCode(new CodeableConceptDt("http://snomed.info/sct", code))
.setClinicalStatus(ConditionClinicalStatusCodesEnum.ACTIVE)
.setVerificationStatus(ConditionVerificationStatusEnum.CONFIRMED)
.setPatient(new ResourceReferenceDt(patient))
.setId("Condition/"+(i+1)));
}
return conditions;
}
示例14: createAsthmaCondition
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private Condition createAsthmaCondition(Patient patient, String id, Severity severity ){
return (Condition) new Condition()
.setCode(new CodeableConceptDt("http://snomed.info/sct", "195967001"))
.setClinicalStatus(ConditionClinicalStatusCodesEnum.ACTIVE)
.setVerificationStatus(ConditionVerificationStatusEnum.CONFIRMED)
.setSeverity(new CodeableConceptDt("http://snomed.info/sct", severity.code))
.setPatient(new ResourceReferenceDt(patient))
.setId(id);
}
示例15: generateBloodPressureObservations
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; //导入依赖的package包/类
private List<Observation> generateBloodPressureObservations(int amount) {
List<Observation> results = new ArrayList<>();
for (int i = 0; i < amount; i++) {
results.add((Observation) new Observation()
.setCode(new CodeableConceptDt("http://loinc.org", "55284-4")) //Diastolic
.setValue(new IntegerDt(random.nextInt(40)+60))
.setId("Observation/"+(i+1)));
}
return results;
}