本文整理汇总了Java中org.hl7.fhir.dstu3.model.Patient类的典型用法代码示例。如果您正苦于以下问题:Java Patient类的具体用法?Java Patient怎么用?Java Patient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Patient类属于org.hl7.fhir.dstu3.model包,在下文中一共展示了Patient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkPatients
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
private void checkPatients(Dataset<Patient> patients) {
List<String> patientIds = patients
.collectAsList()
.stream()
.map(Patient::getId)
.collect(Collectors.toList());
Assert.assertEquals(3, patientIds.size());
List<String> expectedIds = ImmutableList.of(
"Patient/6666001",
"Patient/1032702",
"Patient/9995679");
Assert.assertTrue(patientIds.containsAll(expectedIds));
}
示例2: testSaveAsDatabase
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Test
public void testSaveAsDatabase() {
Bundles.saveAsDatabase(spark,
bundles,
"bundlesdb",
"patient", "condition", "observation");
Dataset<Patient> patients = spark
.sql("select * from bundlesdb.patient")
.as(encoders.of(Patient.class));
checkPatients(patients);
Dataset<Condition> conditions = spark
.sql("select * from bundlesdb.condition")
.as(encoders.of(Condition.class));
checkConditions(conditions);
// Ensure the included observations are present as well.
Assert.assertEquals(72,
spark.sql("select * from bundlesdb.observation")
.count());
}
示例3: setUp
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
/**
* Set up Spark.
*/
@BeforeClass
public static void setUp() {
spark = SparkSession.builder()
.master("local[*]")
.appName("testing")
.getOrCreate();
patientDataset = spark.createDataset(ImmutableList.of(patient),
encoders.of(Patient.class));
decodedPatient = patientDataset.head();
conditionsDataset = spark.createDataset(ImmutableList.of(condition),
encoders.of(Condition.class));
decodedCondition = conditionsDataset.head();
observationsDataset = spark.createDataset(ImmutableList.of(observation),
encoders.of(Observation.class));
decodedObservation = observationsDataset.head();
medDataset = spark.createDataset(ImmutableList.of(medRequest),
encoders.of(MedicationRequest.class));
decodedMedRequest = medDataset.head();
}
示例4: getPolicies
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Override
public List<Evaluatable> getPolicies(XacmlRequestDto xacmlRequest) throws NoPolicyFoundException, PolicyProviderException {
ConsentListAndPatientDto consentListAndPatientDto = searchForFhirPatientAndFhirConsent(xacmlRequest);
Patient fhirPatient = consentListAndPatientDto.getPatient();
List<Consent> fhirConsentList = consentListAndPatientDto.getMatchingConsents();
List<ConsentDto> consentDtoList = convertFhirConsentListToConsentDtoList(fhirConsentList, fhirPatient);
List<PolicyDto> policyDtoList = convertConsentDtoListToXacmlPolicyDtoList(consentDtoList);
PolicyContainerDto policyContainerDto = PolicyContainerDto.builder().policies(policyDtoList).build();
Evaluatable policySet = xacmlPolicySetService.getPoliciesCombinedAsPolicySet(
policyContainerDto,
UUID.randomUUID().toString(),
PolicyCombiningAlgIds.DENY_OVERRIDES.getUrn()
);
return Arrays.asList(policySet);
}
示例5: testGetResourcesByClass
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Test
public void testGetResourcesByClass() {
Dataset<Patient> patients = Bundles.extractEntry(spark, bundles, Patient.class);
Dataset<Condition> conditions = Bundles.extractEntry(spark, bundles, Condition.class);
checkPatients(patients);
checkConditions(conditions);
}
示例6: testGetResourcesByName
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Test
public void testGetResourcesByName() {
Dataset<Patient> patients = Bundles.extractEntry(spark, bundles, "Patient");
Dataset<Condition> conditions = Bundles.extractEntry(spark, bundles, "Condition");
checkPatients(patients);
checkConditions(conditions);
}
示例7: testGetCaseInsensitive
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Test
public void testGetCaseInsensitive() {
Dataset<Patient> patients = Bundles.extractEntry(spark, bundles, "patIENt");
Dataset<Condition> conditions = Bundles.extractEntry(spark, bundles, "conDiTion");
checkPatients(patients);
checkConditions(conditions);
}
示例8: testEncoderCached
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Test
public void testEncoderCached() throws IOException {
Assert.assertSame(encoders.of(Condition.class),
encoders.of(Condition.class));
Assert.assertSame(encoders.of(Patient.class),
encoders.of(Patient.class));
}
示例9: testTransformSimplePatientEntity
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Test
public void testTransformSimplePatientEntity() throws FHIRException {
LocalDate dateOfBirth = LocalDate.of(1996, 6, 21);
final PatientEntity patientEntity = new PatientEntityBuilder()
.setDateOfBirth(dateOfBirth)
.build();
final Patient patient = transformer.transform(patientEntity);
assertThat(patient, not(nullValue()));
assertThat(patient.getActive(), equalTo(true));
assertThat(patient.getName().size(), equalTo(1));
HumanName name = patient.getName().get(0);
assertThat(name.getGivenAsSingleString(), equalTo("John"));
assertThat(name.getFamily(), equalTo("Smith"));
assertThat(name.getUse(), equalTo(HumanName.NameUse.USUAL));
assertThat(name.getPrefixAsSingleString(), equalTo("Mr"));
assertThat(patient.getGender(), equalTo(Enumerations.AdministrativeGender.MALE));
assertThat(patient.getBirthDate(), not(nullValue()));
LocalDate patientDoB = DateUtils.asLocalDate(patient.getBirthDate());
assertThat(patientDoB, equalTo(dateOfBirth));
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:28,代码来源:PatientEntityToFHIRPatientTransformerTest.java
示例10: addPatient
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
@Override
public SignupDto addPatient(SignupDto signupDto) {
logger.info("FHIR is enabled, calling HIE for patient registration");
// convert c2s patient object to FHIR Patient object
Patient patient = fhirResourceConverter.convertToPatient(signupDto);
//logs FHIRPatient into json and xml format in debug mode
logFHIRPatient(patient);
//validate the resource
ValidationResult validationResult = fhirValidator.validateWithResult(patient);
logger.debug("validationResult.isSuccessful(): " + validationResult.isSuccessful());
//throw format error if the validation is not successful
if (!validationResult.isSuccessful()) {
throw new FHIRFormatErrorException("Patient Validation is not successful" + validationResult.getMessages());
}
/*
Use the client to store a new patient resource instance
Invoke the server create method (and send pretty-printed JSON
encoding to the server
instead of the default which is non-pretty printed XML)
*/
MethodOutcome outcome = fhirClient.create().resource(patient).execute();
//TODO: Need to store Eid value once integrate with IExhub
return signupDto;
}
示例11: getPatientAdapterTarget
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
public qicorepatientAdapter getPatientAdapterTarget()
{
if (adaptedClass.getPatient().getResource() instanceof org.hl7.fhir.dstu3.model.Patient)
{
qicorepatientAdapter profiledType = new qicorepatientAdapter();
profiledType
.setAdaptee((org.hl7.fhir.dstu3.model.Patient) adaptedClass
.getPatient().getResource());
return profiledType;
}
else
{
return null;
}
}
示例12: testSearchConsent
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
/**
* Test method for
* {@link org.iexhub.services.JaxRsConsentRestProvider#search\(@IdParam
* final IdDt id)}.
*/
@Test
public void testSearchConsent() {
try {
Logger logger = LoggerFactory.getLogger(ConsentDstu3Test.class);
LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
loggingInterceptor.setLogRequestSummary(true);
loggingInterceptor.setLogRequestBody(true);
loggingInterceptor.setLogger(logger);
IGenericClient client = ctxt.newRestfulGenericClient(serverBaseUrl);
client.registerInterceptor(loggingInterceptor);
Identifier searchParam = new Identifier();
searchParam.setSystem(iExHubDomainOid).setValue(defaultPatientId);
Bundle response = client
.search()
.forResource(Consent.class)
.where(Patient.IDENTIFIER.exactly().identifier(searchParam.getId()))
.returnBundle(Bundle.class).execute();
assertTrue("Error - unexpected return value for testSearchConsent", response != null);
} catch (Exception e) {
fail(e.getMessage());
}
}
示例13: getPerformerPatientTarget
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
public List<Patient> getPerformerPatientTarget() {
List<org.hl7.fhir.dstu3.model.Patient> items = new java.util.ArrayList<>();
List<org.hl7.fhir.dstu3.model.Resource> resources = adaptedClass
.getPerformerTarget();
for (org.hl7.fhir.dstu3.model.Resource resource : resources) {
items.add((org.hl7.fhir.dstu3.model.Patient) resource);
}
return items;
}
示例14: getRecipientPatientTarget
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
public List<Patient> getRecipientPatientTarget() {
List<org.hl7.fhir.dstu3.model.Patient> items = new java.util.ArrayList<>();
List<org.hl7.fhir.dstu3.model.Resource> resources = adaptedClass
.getRecipientTarget();
for (org.hl7.fhir.dstu3.model.Resource resource : resources) {
items.add((org.hl7.fhir.dstu3.model.Patient) resource);
}
return items;
}
示例15: getInformationSourcePatientAdapterTarget
import org.hl7.fhir.dstu3.model.Patient; //导入依赖的package包/类
public qicorepatientAdapter getInformationSourcePatientAdapterTarget()
{
if (adaptedClass.getInformationSource().getResource() instanceof org.hl7.fhir.dstu3.model.Patient)
{
qicorepatientAdapter profiledType = new qicorepatientAdapter();
profiledType
.setAdaptee((org.hl7.fhir.dstu3.model.Patient) adaptedClass
.getInformationSource().getResource());
return profiledType;
}
else
{
return null;
}
}