Skip to content

Commit

Permalink
MHV-53689: Not entered in error flag added to all medical records cal…
Browse files Browse the repository at this point in the history
…ls (#15776)
  • Loading branch information
mattwrightva authored Mar 5, 2024
1 parent 4878f66 commit 66c2c61
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 24 deletions.
33 changes: 23 additions & 10 deletions lib/medical_records/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def get_patient_by_identifier(fhir_client, identifier)
def list_allergies
bundle = fhir_search(FHIR::AllergyIntolerance,
{
search: { parameters: { patient: patient_fhir_id, 'clinical-status': 'active' } },
search: { parameters: { patient: patient_fhir_id, 'clinical-status': 'active',
'verification-status:not': 'entered-in-error' } },
headers: { 'Cache-Control': 'no-cache' }
})
sort_bundle(bundle, :recordedDate, :desc)
Expand All @@ -102,7 +103,7 @@ def get_allergy(allergy_id)
def list_vaccines
bundle = fhir_search(FHIR::Immunization,
{
search: { parameters: { patient: patient_fhir_id } },
search: { parameters: { patient: patient_fhir_id, 'status:not': 'entered-in-error' } },
headers: { 'Cache-Control': 'no-cache' }
})
sort_bundle(bundle, :occurrenceDateTime, :desc)
Expand All @@ -114,24 +115,31 @@ def get_vaccine(vaccine_id)

def list_vitals
loinc_codes = "#{BLOOD_PRESSURE},#{BREATHING_RATE},#{HEART_RATE},#{HEIGHT},#{TEMPERATURE},#{WEIGHT}"
bundle = fhir_search(FHIR::Observation, search: { parameters: { patient: patient_fhir_id, code: loinc_codes } })
bundle = fhir_search(FHIR::Observation,
search: { parameters: { patient: patient_fhir_id, code: loinc_codes,
'status:not': 'entered-in-error' } })
sort_bundle(bundle, :effectiveDateTime, :desc)
end

def list_conditions
bundle = fhir_search(FHIR::Condition, search: { parameters: { patient: patient_fhir_id } })
bundle = fhir_search(FHIR::Condition,
search: { parameters: { patient: patient_fhir_id,
'verification-status:not': 'entered-in-error' } })
sort_bundle(bundle, :recordedDate, :desc)
end

def get_condition(condition_id)
fhir_search(FHIR::Condition, search: { parameters: { _id: condition_id, _include: '*' } })
fhir_search(FHIR::Condition,
search: { parameters: { _id: condition_id, _include: '*',
'verification-status:not': 'entered-in-error' } })
end

def list_clinical_notes
loinc_codes = "#{PHYSICIAN_PROCEDURE_NOTE},#{DISCHARGE_SUMMARY},#{CONSULT_RESULT}"
bundle = fhir_search(FHIR::DocumentReference,
{
search: { parameters: { patient: patient_fhir_id, type: loinc_codes } },
search: { parameters: { patient: patient_fhir_id, type: loinc_codes,
'status:not': 'entered-in-error' } },
headers: { 'Cache-Control': 'no-cache' }
})

Expand All @@ -157,7 +165,8 @@ def get_clinical_note(note_id)
end

def get_diagnostic_report(record_id)
fhir_search(FHIR::DiagnosticReport, search: { parameters: { _id: record_id, _include: '*' } })
fhir_search(FHIR::DiagnosticReport,
search: { parameters: { _id: record_id, _include: '*', 'status:not': 'entered-in-error' } })
end

##
Expand Down Expand Up @@ -214,7 +223,8 @@ def list_labs_and_tests(page_size = 999, page_num = 1)
#
def list_labs_chemhem_diagnostic_report
fhir_search(FHIR::DiagnosticReport,
search: { parameters: { patient: patient_fhir_id, category: 'LAB' } })
search: { parameters: { patient: patient_fhir_id, category: 'LAB',
'status:not': 'entered-in-error' } })
end

##
Expand All @@ -225,7 +235,9 @@ def list_labs_chemhem_diagnostic_report
#
def list_labs_other_diagnostic_report
loinc_codes = "#{MICROBIOLOGY},#{PATHOLOGY}"
fhir_search(FHIR::DiagnosticReport, search: { parameters: { patient: patient_fhir_id, code: loinc_codes } })
fhir_search(FHIR::DiagnosticReport,
search: { parameters: { patient: patient_fhir_id, code: loinc_codes,
'status:not': 'entered-in-error' } })
end

##
Expand All @@ -237,7 +249,8 @@ def list_labs_other_diagnostic_report
def list_labs_document_reference
loinc_codes = "#{EKG},#{RADIOLOGY}"
fhir_search(FHIR::DocumentReference,
search: { parameters: { patient: patient_fhir_id, type: loinc_codes } })
search: { parameters: { patient: patient_fhir_id, type: loinc_codes,
'status:not': 'entered-in-error' } })
end

##
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66c2c61

Please sign in to comment.