Search in sources :

Example 6 with Patient

use of org.hl7.fhir.dstu3.model.Patient in project gpconnect-demonstrator by nhsconnect.

the class PatientResourceProvider method patientDetailsToRegisterPatientResourceConverter.

// a cut-down Patient
private Patient patientDetailsToRegisterPatientResourceConverter(PatientDetails patientDetails) throws FHIRException {
    Patient patient = patientDetailsToMinimalPatient(patientDetails);
    HumanName name = getPatientNameFromPatientDetails(patientDetails);
    patient.addName(name);
    patient = setStaticPatientData(patient);
    return patient;
}
Also used : HumanName(org.hl7.fhir.dstu3.model.HumanName) Patient(org.hl7.fhir.dstu3.model.Patient)

Example 7 with Patient

use of org.hl7.fhir.dstu3.model.Patient in project bunsen by cerner.

the class TestData method newPatient.

/**
 * Returns a FHIR Patient for testing purposes.
 */
public static Patient newPatient() {
    Patient patient = new Patient();
    patient.setId("test-patient");
    patient.setMultipleBirth(new IntegerType(1));
    return patient;
}
Also used : IntegerType(org.hl7.fhir.dstu3.model.IntegerType) Patient(org.hl7.fhir.dstu3.model.Patient)

Example 8 with Patient

use of org.hl7.fhir.dstu3.model.Patient 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 9 with Patient

use of org.hl7.fhir.dstu3.model.Patient in project bunsen by cerner.

the class ValueSetUdfsTest method patient.

private static Patient patient(String id, String marritalStatus) {
    Patient patient = new Patient();
    patient.setId(id);
    patient.setMaritalStatus(codeable("http://hl7.org/fhir/v3/MaritalStatus", marritalStatus));
    return patient;
}
Also used : Patient(org.hl7.fhir.dstu3.model.Patient)

Example 10 with Patient

use of org.hl7.fhir.dstu3.model.Patient in project syndesis-qe by syndesisio.

the class FhirUtils method deleteOnePatient.

private void deleteOnePatient(Patient patient) {
    IdType idtp = new IdType(extractSimpleId(patient.getId(), FhirEntity.PATIENT.getName()));
    checkConnection();
    fhirClient.deletePatientById(idtp);
}
Also used : IdType(org.hl7.fhir.dstu3.model.IdType)

Aggregations

ArrayList (java.util.ArrayList)8 UnprocessableEntityException (ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException)7 Patient (org.hl7.fhir.dstu3.model.Patient)7 FHIRException (org.hl7.fhir.exceptions.FHIRException)7 Reference (org.hl7.fhir.dstu3.model.Reference)6 InvalidRequestException (ca.uhn.fhir.rest.server.exceptions.InvalidRequestException)5 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)5 Extension (org.hl7.fhir.dstu3.model.Extension)5 IdDt (ca.uhn.fhir.model.primitive.IdDt)4 ResourceNotFoundException (ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException)4 Date (java.util.Date)4 Coding (org.hl7.fhir.dstu3.model.Coding)4 AdministrativeGender (org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender)4 DateTimeDt (ca.uhn.fhir.model.primitive.DateTimeDt)3 Search (ca.uhn.fhir.rest.annotation.Search)3 Calendar (java.util.Calendar)3 Collectors (java.util.stream.Collectors)3 IdType (org.hl7.fhir.dstu3.model.IdType)3 IBaseBundle (org.hl7.fhir.instance.model.api.IBaseBundle)3 PatientDetails (uk.gov.hscic.model.patient.PatientDetails)3