Nwebie ask a question regarding patient read

Hello,
I am a newbie and want to learn FHIR. I would like to begin my learning by doing a SimpleRead by giving a patientID , and hope that I would receive back a patient record.

For example my SimpleRead would have the following code below. My question is what is a good patientID that I should use in order to get a patient record .

Thanks so much.

public class SimpleRead {

IGenericClient client = null;

public SimpleRead(String baseUrl) {
    FhirContext ctx = FhirContext.forDstu3();
    client = ctx.newRestfulGenericClient(baseUrl);
}

/**
 * Find the patient with the given ID and return the full name as a
 * single string.
 */
public String getNameByPatientID(String id) {
    // Hint, there is a method that will return the full name including
    // prefix, first, last, and suffix
    //Place your code here
    return "";//just so it will compile, return nothing
}

/**
 * Find all the patients that have the provided name and return a list
 * of the IDs for those patients.  The search should include matches
 * where any part of the patient name (family, given, prefix, etc.)
 * matches the method 'name' parameter.
 */
public List<String> getIDByPatientName(String name) {
    //Place your code here
    return new ArrayList<String>();//just so it will compile, return nothing
}

}

It depends on what server you’re hitting. Some of the test servers will host the examples from the spec and use the ids from the spec. Others will use their own ids. The best thing to do is to hit the test server using a web browser and just query the Patient endpoint with no filters. That’ll give you a page worth of patients. Pick one of the ids and go to town :slight_smile:

1 Like