Skip to content

Commit

Permalink
(feat) O3-4063: Ward App - update encounter types to use for Inpatien…
Browse files Browse the repository at this point in the history
…t Notes and Transfer Request
  • Loading branch information
mogoodrich committed Oct 7, 2024
1 parent 6d5dfdf commit 783e416
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions __mocks__/emr-configuration.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ export const emrConfigurationMock = {
consultFreeTextCommentsConcept: { uuid: '162169AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' },
visitNoteEncounterType: { uuid: 'd7151f82-c1f3-4152-a605-2f9ea7414a79' },
admissionEncounterType: { uuid: 'e8151f82-c1f3-4152-a605-2f9ea7414a79' },
inpatientNoteEncounterType: { uuid: 'f8151f82-c1f3-4152-a605-2f9ea7414a79' },
transferRequestEncounterType: { uuid: 'g8151f82-c1f3-4152-a605-2f9ea7414a79' },
};
4 changes: 4 additions & 0 deletions packages/esm-ward-app/src/hooks/useEmrConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ interface EmrApiConfigurationResponse {
clinicianEncounterRole: OpenmrsResource;
consultFreeTextCommentsConcept: OpenmrsResource;
visitNoteEncounterType: OpenmrsResource;
inpatientNoteEncounterType: OpenmrsResource;
transferRequestEncounterType: OpenmrsResource;
transferWithinHospitalEncounterType: OpenmrsResource;
exitFromInpatientEncounterType: OpenmrsResource;
supportsTransferLocationTag: LocationTag;
Expand Down Expand Up @@ -65,6 +67,8 @@ const customRepProps = [
['diagnosisSets', 'ref'],
['personImageDirectory', 'ref'],
['visitNoteEncounterType', 'ref'],
['inpatientNoteEncounterType', 'ref'],
['transferRequestEncounterType', 'ref'],
['consultEncounterType', 'ref'],
['diagnosisMetadata', 'ref'],
['narrowerThanConceptMapType', 'ref'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export default function PatientTransferForm({
formState: { errors, isDirty },
control,
handleSubmit,
getValues,
setValue,
} = useForm<FormValues>({ resolver: zodResolver(zodSchema), defaultValues: formDefaultValues });

Expand Down Expand Up @@ -104,7 +103,7 @@ export default function PatientTransferForm({

createEncounter({
patient: patient?.uuid,
encounterType: emrConfiguration.visitNoteEncounterType.uuid,
encounterType: emrConfiguration.transferRequestEncounterType.uuid,
location: location.uuid,
encounterProviders: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const PatientNotesForm: React.FC<PatientNotesFormProps> = ({
const notePayload = {
patient: patientUuid,
location: locationUuid,
encounterType: emrConfiguration?.visitNoteEncounterType.uuid,
encounterType: emrConfiguration?.inpatientNoteEncounterType.uuid,
encounterProviders: [
{
encounterRole: emrConfiguration?.clinicianEncounterRole.uuid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test('renders a success snackbar upon successfully recording a visit note', asyn
provider: undefined,
},
]),
encounterType: emrConfigurationMock.visitNoteEncounterType.uuid,
encounterType: emrConfigurationMock.inpatientNoteEncounterType.uuid,
location: undefined,
obs: expect.arrayContaining([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ interface PatientNotesHistoryProps {

const PatientNotesHistory: React.FC<PatientNotesHistoryProps> = ({ patientUuid, visitUuid }) => {
const { t } = useTranslation();
const { emrConfiguration, isLoadingEmrConfiguration, errorFetchingEmrConfiguration } = useEmrConfiguration();
const { emrConfiguration, isLoadingEmrConfiguration } = useEmrConfiguration();

const { patientNotes, isLoadingPatientNotes, errorFetchingPatientNotes } = usePatientNotes(
patientUuid,
visitUuid,
emrConfiguration?.visitNoteEncounterType?.uuid,
emrConfiguration?.inpatientNoteEncounterType?.uuid,
emrConfiguration?.consultFreeTextCommentsConcept.uuid,
);

Expand Down

0 comments on commit 783e416

Please sign in to comment.