Package com.framed.interop.hl7.hl7v2
Record Class PatientContext
java.lang.Object
java.lang.Record
com.framed.interop.hl7.hl7v2.PatientContext
- Record Components:
mrn- medical record number (PID-3)lastName- family name (PID-5)firstName- given name (PID-5)dob- date of birth, HL7yyyyMMdd(PID-7); may be emptysex- administrative sex (PID-8); may be emptylocation- patient location / point of care (PV1-3); may be empty
public record PatientContext(String mrn, String lastName, String firstName, String dob, String sex, String location)
extends Record
Static patient/encounter context used to populate the
PID/PV1 segments of
outbound messages. In this first iteration it is supplied from configuration; later it can be
refreshed from inbound ADT.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondob()Returns the value of thedobrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstNamerecord component.static PatientContextfromJson(org.json.JSONObject json) Builds a context from a config JSON object, defaulting missing fields to empty/UNKNOWN.final inthashCode()Returns a hash code value for this object.lastName()Returns the value of thelastNamerecord component.location()Returns the value of thelocationrecord component.mrn()Returns the value of themrnrecord component.sex()Returns the value of thesexrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PatientContext
public PatientContext(String mrn, String lastName, String firstName, String dob, String sex, String location) Creates an instance of aPatientContextrecord class.- Parameters:
mrn- the value for themrnrecord componentlastName- the value for thelastNamerecord componentfirstName- the value for thefirstNamerecord componentdob- the value for thedobrecord componentsex- the value for thesexrecord componentlocation- the value for thelocationrecord component
-
-
Method Details
-
fromJson
Builds a context from a config JSON object, defaulting missing fields to empty/UNKNOWN. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
mrn
Returns the value of themrnrecord component.- Returns:
- the value of the
mrnrecord component
-
lastName
Returns the value of thelastNamerecord component.- Returns:
- the value of the
lastNamerecord component
-
firstName
Returns the value of thefirstNamerecord component.- Returns:
- the value of the
firstNamerecord component
-
dob
Returns the value of thedobrecord component.- Returns:
- the value of the
dobrecord component
-
sex
Returns the value of thesexrecord component.- Returns:
- the value of the
sexrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-
