MeasurementsResource
Builds, saves and reads measurement Observations.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.24+fa54770
public final class MeasurementsResourceBuilds, saves and reads measurement Observations. Get it from Ovok.measurements().
Methods
save
public MeasurementsResource.SaveObservationsResult save(
Map<String, ?> parameters) throws IOException, InterruptedExceptionBuilds Observations from measurement values and saves them in one FHIR transaction.
Parameters:
parameters: the measurement values;patientIdnames the patient, otherwise the signed-in user's patient is used
Returns: the save status and the FHIR transaction response
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public MeasurementsResource.SaveObservationsResult save(
Map<String, ?> parameters,
SaveObservationsOptions options) throws IOException, InterruptedExceptionBuilds Observations from measurement values and saves them in one FHIR transaction.
Parameters:
parameters: the measurement values;patientIdnames the patient, otherwise the signed-in user's patient is usedoptions: save options;nulluses the defaults
Returns: the save status and the FHIR transaction response
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
saveObservations
public MeasurementsResource.SaveObservationsResult saveObservations(
List<JsonNode> observations) throws IOException, InterruptedExceptionSaves Observations in one FHIR transaction.
Parameters:
observations: the Observations to save
Returns: the save status and the FHIR transaction response
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public MeasurementsResource.SaveObservationsResult saveObservations(
List<JsonNode> observations,
SaveObservationsOptions options) throws IOException, InterruptedExceptionSaves Observations in one FHIR transaction.
Parameters:
observations: the Observations to saveoptions: save options;nulluses the defaults
Returns: the save status and the FHIR transaction response
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the responseOvokConflictException: if the signed-in account changes during the save
build
public List<JsonNode> build(Map<String, ?> parameters)Builds Observations from measurement values without sending them.
Parameters:
parameters: the measurement values;patientIdnames the patient, otherwise the signed-in user's patient is used
Returns: the Observations
Throws:
OvokValidationException: if no patient is named and no user is signed in
latest
public JsonNode latest(Map<String, ?> parameters) throws IOException, InterruptedExceptionReads the latest Observation per code (GET /fhir/Observation/$lastn).
Parameters:
parameters:patientIdorme: true,codes, and an optionaldatelower bound
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode latest(
Map<String, ?> parameters,
RequestOptions options) throws IOException, InterruptedExceptionReads the latest Observation per code (GET /fhir/Observation/$lastn).
Parameters:
parameters:patientIdorme: true,codes, and an optionaldatelower boundoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
lastForPatient
public JsonNode lastForPatient(
String patientId,
Map<String, ?> query) throws IOException, InterruptedExceptionReads a patient's last observations (GET /patient/{patientId}/observation).
Parameters:
patientId: the patient IDquery: query parameters, sent as given
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode lastForPatient(
String patientId,
Map<String, ?> query,
RequestOptions options) throws IOException, InterruptedExceptionReads a patient's last observations (GET /patient/{patientId}/observation).
Parameters:
patientId: the patient IDquery: query parameters, sent as givenoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
codesFor
public String codesFor(List<String> measurementTypes)Returns the comma-separated LOINC codes for measurement types.
Parameters:
measurementTypes: the measurement type names
Returns: the codes, joined with commas
MeasurementsResource.SaveObservationsResult
public static record SaveObservationsResult(String status, JsonNode response)Result of saving Observations.
Components:
status: the save status,savedresponse: the FHIR transaction response
Last updated on