Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

O3-4063: Ward App - update encounter types to use for Inpatient Notes… #1337

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random unused variable picked up by the linter.

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();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a random unused variable picked up by the linter

const { emrConfiguration, isLoadingEmrConfiguration } = useEmrConfiguration();

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

Expand Down
Loading