Method: DdeClient::DdeService#create_patient_footprint
- Defined in:
- app/services/dde_client/dde_service.rb
#create_patient_footprint(patient, date = nil, creator_id = nil) ⇒ Object
Pushes a footprint for patient in current visit_type to Dde
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'app/services/dde_client/dde_service.rb', line 97 def create_patient_footprint(patient, date = nil, creator_id = nil) LOGGER.debug("Pushing footprint to Dde for patient ##{patient.patient_id}") doc_id = find_patient_doc_id(patient) unless doc_id LOGGER.debug("Patient ##{patient.patient_id} is not a Dde patient") return end response, status = dde_client.post('update_footprint', person_uuid: doc_id, location_id: Location.current_location_health_center.location_id, visit_type_id: visit_type.id, encounter_datetime: date || Date.tody, user_id: creator_id || User.current.user_id) LOGGER.warn("Failed to push patient footprint to Dde: #{status} - #{response}") unless status == 200 end |