本文整理汇总了Java中ca.uhn.fhir.model.dstu2.resource.Patient.SP_FAMILY属性的典型用法代码示例。如果您正苦于以下问题:Java Patient.SP_FAMILY属性的具体用法?Java Patient.SP_FAMILY怎么用?Java Patient.SP_FAMILY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ca.uhn.fhir.model.dstu2.resource.Patient
的用法示例。
在下文中一共展示了Patient.SP_FAMILY属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findReportsWithChain
@Search
public List<DiagnosticReport> findReportsWithChain(
@RequiredParam(name=DiagnosticReport.SP_SUBJECT, chainWhitelist= {Patient.SP_FAMILY, Patient.SP_GENDER}) ReferenceParam theSubject
) {
List<DiagnosticReport> retVal=new ArrayList<DiagnosticReport>();
String chain = theSubject.getChain();
if (Patient.SP_FAMILY.equals(chain)) {
String familyName = theSubject.getValue();
// .. populate with reports matching subject family name ..
}
if (Patient.SP_GENDER.equals(chain)) {
String gender = theSubject.getValue();
// .. populate with reports matching subject gender ..
}
return retVal;
}
示例2: findReportsWithChainCombo
@Search
public List<DiagnosticReport> findReportsWithChainCombo (
@RequiredParam(name=DiagnosticReport.SP_SUBJECT, chainWhitelist= {"", Patient.SP_FAMILY}) ReferenceParam theSubject
) {
List<DiagnosticReport> retVal=new ArrayList<DiagnosticReport>();
String chain = theSubject.getChain();
if (Patient.SP_FAMILY.equals(chain)) {
String familyName = theSubject.getValue();
// .. populate with reports matching subject family name ..
}
if ("".equals(chain)) {
String resourceId = theSubject.getValue();
// .. populate with reports matching subject with resource ID ..
}
return retVal;
}
示例3: searchByLastName
@Search()
public List<Patient> searchByLastName(@RequiredParam(name=Patient.SP_FAMILY) StringParam theFamily) {
String valueToMatch = theFamily.getValue();
if (theFamily.isExact()) {
// Do an exact match search
} else {
// Do a fuzzy search if possible
}
// ...populate...
Patient patient = new Patient();
patient.addIdentifier().setSystem("urn:mrns").setValue("12345");
patient.addName().addFamily("Smith").addGiven("Tester").addGiven("Q");
// ...etc...
// Every returned resource must have its logical ID set. If the server
// supports versioning, that should be set too
String logicalId = "4325";
String versionId = "2"; // optional
patient.setId(new IdDt("Patient", logicalId, versionId));
/*
* This is obviously a fairly contrived example since we are always
* just returning the same hardcoded patient, but in a real scenario
* you could return as many resources as you wanted, and they
* should actually match the given search criteria.
*/
List<Patient> retVal = new ArrayList<Patient>();
retVal.add(patient);
return retVal;
}
示例4: searchByNames
@Search()
public List<Patient> searchByNames( @RequiredParam(name=Patient.SP_FAMILY) StringParam theFamilyName,
@OptionalParam(name=Patient.SP_GIVEN) StringParam theGivenName ) {
String familyName = theFamilyName.getValue();
String givenName = theGivenName != null ? theGivenName.getValue() : null;
List<Patient> retVal = new ArrayList<Patient>();
// ...populate...
return retVal;
}
示例5: searchWithDocs
@Description(shortDefinition="This search finds all patient resources matching a given name combination")
@Search()
public List<Patient> searchWithDocs(
@Description(shortDefinition="This is the patient's last name - Supports partial matches")
@RequiredParam(name=Patient.SP_FAMILY) StringParam theFamilyName,
@Description(shortDefinition="This is the patient's given names")
@OptionalParam(name=Patient.SP_GIVEN) StringParam theGivenName ) {
List<Patient> retVal = new ArrayList<Patient>();
// ...populate...
return retVal;
}
示例6: search
/**
* Search for Patient resources matching a given family name
*/
@Search
public IBundleProvider search(@RequiredParam(name = Patient.SP_FAMILY) StringParam theFamily) {
final InstantDt searchTime = InstantDt.withCurrentTime();
/*
* First, we'll search the database for a set of database row IDs that
* match the given search criteria. That way we can keep just the
* row IDs around, and load the actual resources on demand later
* as the client pages through them.
*/
final List<Long> matchingResourceIds = null; // <-- implement this
/*
* Return a bundle provider which can page through the IDs and
* return the resources that go with them.
*/
return new IBundleProvider() {
@Override
public int size() {
return matchingResourceIds.size();
}
@Override
public List<IResource> getResources(int theFromIndex, int theToIndex) {
int end = Math.max(theToIndex, matchingResourceIds.size() - 1);
List<Long> idsToReturn = matchingResourceIds.subList(theFromIndex, end);
return loadResourcesByIds(idsToReturn);
}
@Override
public InstantDt getPublished() {
return searchTime;
}
@Override
public Integer preferredPageSize() {
// Typically this method just returns null
return null;
}
};
}
示例7: getPatient
/**
* The "@Search" annotation indicates that this method supports the
* search operation. You may have many different method annotated with
* this annotation, to support many different search criteria. This
* example searches by family name.
*
* @param theFamilyName
* This operation takes one parameter which is the search criteria. It is
* annotated with the "@Required" annotation. This annotation takes one argument,
* a string containing the name of the search criteria. The datatype here
* is StringParam, but there are other possible parameter types depending on the
* specific search criteria.
* @return
* This method returns a list of Patients. This list may contain multiple
* matching resources, or it may also be empty.
*/
@Search()
public List<Patient> getPatient(@RequiredParam(name = Patient.SP_FAMILY) StringParam theFamilyName) {
Patient patient = new Patient();
patient.addIdentifier();
patient.getIdentifier().get(0).setUse(IdentifierUseEnum.OFFICIAL);
patient.getIdentifier().get(0).setSystem(new UriDt("urn:hapitest:mrns"));
patient.getIdentifier().get(0).setValue("00001");
patient.addName();
patient.getName().get(0).addFamily(theFamilyName.getValue());
patient.getName().get(0).addGiven("PatientOne");
patient.setGender(AdministrativeGenderEnum.MALE);
return Collections.singletonList(patient);
}
示例8: getPatient
/**
* The "@Search" annotation indicates that this method supports the
* search operation. You may have many different method annotated with
* this annotation, to support many different search criteria. This
* example searches by family name.
*
* @param theIdentifier
* This operation takes one parameter which is the search criteria. It is
* annotated with the "@Required" annotation. This annotation takes one argument,
* a string containing the name of the search criteria. The datatype here
* is StringDt, but there are other possible parameter types depending on the
* specific search criteria.
* @return
* This method returns a list of Patients. This list may contain multiple
* matching resources, or it may also be empty.
*/
@Search()
public List<Patient> getPatient(@RequiredParam(name = Patient.SP_FAMILY) StringDt theFamilyName) {
Patient patient = new Patient();
patient.addIdentifier();
patient.getIdentifier().get(0).setUse(IdentifierUseEnum.OFFICIAL);
patient.getIdentifier().get(0).setSystem(new UriDt("urn:hapitest:mrns"));
patient.getIdentifier().get(0).setValue("00001");
patient.addName();
patient.getName().get(0).addFamily("Test");
patient.getName().get(0).addGiven("PatientOne");
patient.setGender(AdministrativeGenderEnum.MALE);
return Collections.singletonList(patient);
}
示例9: getPatient
/**
* The "@Search" annotation indicates that this method supports the
* search operation. You may have many different method annotated with
* this annotation, to support many different search criteria. This
* example searches by family name.
*
* @param theIdentifier
* This operation takes one parameter which is the search criteria. It is
* annotated with the "@Required" annotation. This annotation takes one argument,
* a string containing the name of the search criteria. The datatype here
* is StringDt, but there are other possible parameter types depending on the
* specific search criteria.
* @return
* This method returns a list of Patients. This list may contain multiple
* matching resources, or it may also be empty.
*/
@Search()
public List<Patient> getPatient(@RequiredParam(name = Patient.SP_FAMILY) StringDt theFamilyName);