Search in sources :

Example 1 with CodeableConcept

use of org.hl7.fhir.r4.model.CodeableConcept in project gpconnect-demonstrator by nhsconnect.

the class PatientResourceProvider method setStaticPatientData.

private Patient setStaticPatientData(Patient patient) {
    patient.setLanguage(("en-GB"));
    patient.addExtension(createCodingExtension("CG", "Greek Cypriot", SystemURL.CS_CC_ETHNIC_CATEGORY, SystemURL.SD_CC_EXT_ETHNIC_CATEGORY));
    patient.addExtension(createCodingExtension("SomeSnomedCode", "Some Snomed Code", SystemURL.CS_CC_RELIGIOUS_AFFILI, SystemURL.SD_CC_EXT_RELIGIOUS_AFFILI));
    patient.addExtension(new Extension(SystemURL.SD_PATIENT_CADAVERIC_DON, new BooleanType(false)));
    patient.addExtension(createCodingExtension("H", "UK Resident", SystemURL.CS_CC_RESIDENTIAL_STATUS, SystemURL.SD_CC_EXT_RESIDENTIAL_STATUS));
    patient.addExtension(createCodingExtension("3", "To pay hotel fees only", SystemURL.CS_CC_TREATMENT_CAT, SystemURL.SD_CC_EXT_TREATMENT_CAT));
    Extension nhsCommExtension = new Extension();
    nhsCommExtension.setUrl(SystemURL.SD_CC_EXT_NHS_COMMUNICATION);
    nhsCommExtension.addExtension(createCodingExtension("en", "English", SystemURL.CS_CC_HUMAN_LANG, SystemURL.SD_CC_EXT_COMM_LANGUAGE));
    nhsCommExtension.addExtension(new Extension(SystemURL.SD_CC_COMM_PREFERRED, new BooleanType(false)));
    nhsCommExtension.addExtension(createCodingExtension("RWR", "Received written", SystemURL.CS_CC_LANG_ABILITY_MODE, SystemURL.SD_CC_MODE_OF_COMM));
    nhsCommExtension.addExtension(createCodingExtension("E", "Excellent", SystemURL.CS_CC_LANG_ABILITY_PROFI, SystemURL.SD_CC_COMM_PROFICIENCY));
    nhsCommExtension.addExtension(new Extension(SystemURL.SD_CC_INTERPRETER_REQUIRED, new BooleanType(false)));
    patient.addExtension(nhsCommExtension);
    Identifier localIdentifier = new Identifier();
    localIdentifier.setUse(IdentifierUse.USUAL);
    localIdentifier.setSystem(SystemURL.ID_LOCAL_PATIENT_IDENTIFIER);
    localIdentifier.setValue("123456");
    CodeableConcept liType = new CodeableConcept();
    Coding liTypeCoding = new Coding();
    liTypeCoding.setCode("EN");
    liTypeCoding.setDisplay("Employer number");
    liTypeCoding.setSystem(SystemURL.VS_IDENTIFIER_TYPE);
    liType.addCoding(liTypeCoding);
    localIdentifier.setType(liType);
    localIdentifier.setAssigner(new Reference("Organization/1"));
    patient.addIdentifier(localIdentifier);
    Calendar calendar = Calendar.getInstance();
    calendar.set(2017, 1, 1);
    DateTimeDt endDate = new DateTimeDt(calendar.getTime());
    calendar.set(2016, 1, 1);
    DateTimeDt startDate = new DateTimeDt(calendar.getTime());
    Period pastPeriod = new Period().setStart(calendar.getTime()).setEnd(calendar.getTime());
    patient.addName().setFamily("AnotherOfficialFamilyName").addGiven("AnotherOfficialGivenName").setUse(NameUse.OFFICIAL).setPeriod(pastPeriod);
    patient.addName().setFamily("AdditionalFamily").addGiven("AdditionalGiven").setUse(NameUse.TEMP);
    patient.addTelecom(staticElHelper.getValidTelecom());
    patient.addAddress(staticElHelper.getValidAddress());
    return patient;
}
Also used : Extension(org.hl7.fhir.dstu3.model.Extension) Identifier(org.hl7.fhir.dstu3.model.Identifier) DateTimeDt(ca.uhn.fhir.model.primitive.DateTimeDt) Coding(org.hl7.fhir.dstu3.model.Coding) Reference(org.hl7.fhir.dstu3.model.Reference) Calendar(java.util.Calendar) BooleanType(org.hl7.fhir.dstu3.model.BooleanType) Period(org.hl7.fhir.dstu3.model.Period) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 2 with CodeableConcept

use of org.hl7.fhir.r4.model.CodeableConcept in project gpconnect-demonstrator by nhsconnect.

the class PatientResourceProvider method getValidContact.

private ContactDetail getValidContact() {
    HumanName ctName = new HumanName();
    ctName.setUse(NameUse.OFFICIAL);
    ctName.setFamily("FamilyName");
    List<CodeableConcept> ctRelList = new ArrayList<>();
    ctRelList.add(createCoding("family", "Family", SystemURL.VS_PATIENT_CONTACT_REL));
    ContactDetail contact = new ContactDetail();
    contact.setName(ctName.toString());
    contact.addTelecom(staticElHelper.getValidTelecom());
    return contact;
}
Also used : ContactDetail(org.hl7.fhir.dstu3.model.ContactDetail) HumanName(org.hl7.fhir.dstu3.model.HumanName) ArrayList(java.util.ArrayList) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 3 with CodeableConcept

use of org.hl7.fhir.r4.model.CodeableConcept in project gpconnect-demonstrator by nhsconnect.

the class PatientResourceProvider method createCoding.

private CodeableConcept createCoding(String code, String display, String vsSystem) {
    Coding coding = new Coding();
    coding.setCode(code);
    coding.setDisplay(display);
    coding.setSystem(vsSystem);
    CodeableConcept concept = new CodeableConcept();
    concept.addCoding(coding);
    return concept;
}
Also used : Coding(org.hl7.fhir.dstu3.model.Coding) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 4 with CodeableConcept

use of org.hl7.fhir.r4.model.CodeableConcept in project bunsen by cerner.

the class TestData method newCondition.

/**
 * Returns a FHIR Condition for testing purposes.
 */
public static Condition newCondition() {
    Condition condition = new Condition();
    // Condition based on example from FHIR:
    // https://www.hl7.org/fhir/condition-example.json.html
    condition.setId("Condition/example");
    condition.setLanguage("en_US");
    // Narrative text
    Narrative narrative = new Narrative();
    narrative.setStatusAsString("generated");
    narrative.setDivAsString("This data was generated for test purposes.");
    XhtmlNode node = new XhtmlNode();
    node.setNodeType(NodeType.Text);
    node.setValue("Severe burn of left ear (Date: 24-May 2012)");
    condition.setText(narrative);
    condition.setSubject(new Reference("Patient/example").setDisplay("Here is a display for you."));
    condition.setVerificationStatus(Condition.ConditionVerificationStatus.CONFIRMED);
    // Condition code
    CodeableConcept code = new CodeableConcept();
    code.addCoding().setSystem("http://snomed.info/sct").setCode("39065001").setDisplay("Severe");
    condition.setSeverity(code);
    // Severity code
    CodeableConcept severity = new CodeableConcept();
    severity.addCoding().setSystem("http://snomed.info/sct").setCode("24484000").setDisplay("Burn of ear").setUserSelected(true);
    condition.setSeverity(severity);
    // Onset date time
    DateTimeType onset = new DateTimeType();
    onset.setValueAsString("2012-05-24");
    condition.setOnset(onset);
    return condition;
}
Also used : Condition(org.hl7.fhir.dstu3.model.Condition) DateTimeType(org.hl7.fhir.dstu3.model.DateTimeType) Narrative(org.hl7.fhir.dstu3.model.Narrative) Reference(org.hl7.fhir.dstu3.model.Reference) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Example 5 with CodeableConcept

use of org.hl7.fhir.r4.model.CodeableConcept in project bunsen by cerner.

the class TestData method newMedRequest.

/**
 * Returns a FHIR medication request for testing purposes.
 */
public static MedicationRequest newMedRequest() {
    MedicationRequest medReq = new MedicationRequest();
    medReq.setId("test-med");
    // Medication code
    CodeableConcept med = new CodeableConcept();
    med.addCoding().setSystem("http://www.nlm.nih.gov/research/umls/rxnorm").setCode("582620").setDisplay("Nizatidine 15 MG/ML Oral Solution [Axid]");
    med.setText("Nizatidine 15 MG/ML Oral Solution [Axid]");
    medReq.setMedication(med);
    Annotation annotation = new Annotation();
    annotation.setText("Test medication note.");
    annotation.setAuthor(new Reference("Provider/example").setDisplay("Example provider."));
    medReq.addNote(annotation);
    return medReq;
}
Also used : MedicationRequest(org.hl7.fhir.dstu3.model.MedicationRequest) Reference(org.hl7.fhir.dstu3.model.Reference) Annotation(org.hl7.fhir.dstu3.model.Annotation) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept)

Aggregations

CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)16 Coding (org.hl7.fhir.dstu3.model.Coding)12 Reference (org.hl7.fhir.dstu3.model.Reference)8 IdType (org.hl7.fhir.dstu3.model.IdType)5 ArrayList (java.util.ArrayList)4 Extension (org.hl7.fhir.dstu3.model.Extension)4 Date (java.util.Date)3 Period (org.hl7.fhir.dstu3.model.Period)3 FHIRException (org.hl7.fhir.exceptions.FHIRException)3 Outcome (org.monarchinitiative.loinc2hpocore.codesystems.Outcome)3 SlotDetail (uk.gov.hscic.model.appointment.SlotDetail)3 UnprocessableEntityException (ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException)2 AllergyIntolerance (org.hl7.fhir.dstu3.model.AllergyIntolerance)2 ContactDetail (org.hl7.fhir.dstu3.model.ContactDetail)2 DateTimeType (org.hl7.fhir.dstu3.model.DateTimeType)2 HumanName (org.hl7.fhir.dstu3.model.HumanName)2 Identifier (org.hl7.fhir.dstu3.model.Identifier)2 Location (org.hl7.fhir.dstu3.model.Location)2 Narrative (org.hl7.fhir.dstu3.model.Narrative)2 OperationOutcomeIssueComponent (org.hl7.fhir.dstu3.model.OperationOutcome.OperationOutcomeIssueComponent)2