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

Added matching rule to audit trail table #181

Conversation

NyashaMuusha
Copy link
Collaborator

AuditTRail

1. Description of changes

Modified response from response from back end for the audit trails (ExpandedAuditTrail)
Expanded the response by adding a field called matching rule
Extracted the score using a regex expression on the (EventAuditTrailEntry)

Added a column on the audit trail (Matching Rule)
Displayed matching rule on the audit trail table

2. Testing

Navigate to

  1. http://localhost:3001/browse-records
  2. select a record which will direct you to http://localhost:3001/record-details

@@ -30,7 +30,7 @@ import { PatientRecord, GoldenRecord, AnyRecord } from 'types/PatientRecord'
import { sortColumns } from 'utils/helpers'
import getCellComponent from 'components/shared/getCellComponent'
import { AUDIT_TRAIL_COLUMNS } from 'utils/constants'
import { AuditTrail } from 'types/AuditTrail'
import { AuditTrail, ExpandedAuditTrail } from 'types/AuditTrail'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont think you should create a new type. The change is too small (i.e not worth the extra complexities) . Just update the current version of the AuditTrail type with the additional type.

@@ -419,6 +455,35 @@ export class ApiClient {
}
}

const extractMatchingRule = (input: string ) => {
Copy link
Collaborator

@walisc walisc Feb 20, 2024

Choose a reason for hiding this comment

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

This is not the correct way of doing this. As much as possible avoid using heuristic for your logic...i.e assuming the string will always be of a particular format , or if the score is x then it is DETERMINISTIC (this is actually not the case always)

What you want to do is send back this data with the correct info already, removing the need to use heuristic. i.e getGoldenRecordAuditTrail should return a json object like

[
   {
      "text": "Matched with score....etc",
      "matchType": "DETERMINISTIC"
   }
]

and then extract the information from there

@NyashaMuusha NyashaMuusha deleted the JMPI-add-matching-rule-to-audit-trail branch February 22, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants