PharmaLedger-IMI / ctr-workspace

UC8 Clinical Trials Recruitment
MIT License
2 stars 0 forks source link

Patient contact clinical site #50

Closed joaoluis-pdm closed 2 years ago

joaoluis-pdm commented 2 years ago

(This is an extension of issue #5 )

Implement the feature for patients to contact a clinical site when viewing a match result (with a positive match) or answering a pre-screener for a single trial that matched.

image

Email from: 14th September 2021 17:54

Meanwhile, I re-send below one blocking question to develop F-6-4 (Clinical Sites need to access patient enrollment status). (Short version: If all the contact between the patient and the clinical site goes through the patient-ssapp, then we have to develop those 2-way "messaging features" from scratch. If the patient supplies an email or phone for clinical site contact, then the patient is no longer anonymous - from that point on. ... But I guess that this last option is unavoidable).

Meeting 2021-09-21:

PDM will implement an extra dialog on contacting the clinical site to ask the patient to confirm the name and email for contact purposes.

joaoluis-pdm commented 2 years ago

The "My Patients" backoffice view (from the Clinical Site app) will not be implemented:

image

because that would imply that the identity of the patient is established across multiple-trials, and contradicts the "de-identified patient" requirement.

So far each patient application has only a name and email (and possibly phone), and there is no patient identity concept on the database.

joaoluis-pdm commented 2 years ago

ctr-patient/patient-ssapp changes:

Controllers ClinicalTrialAns60InfoController, MatchInfo20Controller, MatchRequestNew60InfoController: When there is a match enable (display) the "CONTACT CLINICAL SITE" button, and handle it.

The button handled should display a modal asking for:

Name: ... filled with the default participant name
Email: ... filled with the default participant email
I authorise the clinical site to use this data (along with my pre-screener answers) for trial contact purposes.
CONTACT

When the "CONTACT" button is pressed, it must call the middleware /ctr-match-service/apply using a new method in ctr-patient/ctr-dsu-wizard/services/MatchRequestService.js "apply(data, callback(err))". See REST parameters for data contents.

(It may not be a modal, but at this time seems that a model might be easier to write).

ctr-patient/ctr-dsu-wizard/middleware changes:

Associate a new localhost endpoint /ctr-match-service/apply to call REST /borest/ctrms/apply

ctr-backoffice-backend changes:

POST /borest/ctrms/apply - create a new Application record. The body must contain:

{
    name: "string",
    email: "string",
    matchRequest: "const keySSI string",
    clinicalSite: "UUID string",
    clinicalTrial: "UUID string"
}

GET /borest/ctrial/application?clinicalTrial=UUID - return a paged list of applications for this trial. Use the same paged parameters as in GET /borest/ctrial/clinicaltrial

joaoluis-pdm commented 2 years ago

@pccosta-pdm the name is "undefined undefined" image (also the name and email are supposed to be editable, but for the moment, we may consider leaving this from the target for next tuesday morning).

joaoluis-pdm commented 2 years ago

@pccosta-pdm the implementation at MatchInfo20Controller.js seems broken. image

(If it is intentionally broken, please leave the "(DOES NOT WORK)" comment on the button).

joaoluis-pdm commented 2 years ago

@pccosta-pdm another error candidate (might not be an error) image

contact-clinical-site-button.patientIdentity newValue=  error= SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at ContactClinicalSiteButton.watchPatientIdentity (contact-clinical-site-button.entry.js:31)
    at index-7c719aff.js:1839
    at Array.map (<anonymous>)
    ...
pccosta-pdm commented 2 years ago

@joaoluis-pdm, issues fixed.

on

contact-clinical-site-button.patientIdentity newValue= error= SyntaxError: Unexpected end of JSON input at JSON.parse () at ContactClinicalSiteButton.watchPatientIdentity (contact-clinical-site-button.entry.js:31) at index-7c719aff.js:1839 at Array.map () ...

it's not a "error" (it's because on the application initialization the initial value is "undefined"), however I put a condition to show the message when the property is set intentionally.

joaoluis-pdm commented 2 years ago

Seems all fixed!

joaoluis-pdm commented 2 years ago

@pccosta-pdm The "CONTACT CLINICAL SITE" seems to allow contact even if there is no match. That seems a defect. image

... as the spec says

When there is a match enable (display) the "CONTACT CLINICAL SITE" button, and handle it.

I think that this affects mostly ClinicalTrialAns60InfoController but is also related to bug #51

joaoluis-pdm commented 2 years ago

@pccosta-pdm the check for double-contact should be done using an internal database that also appears on the dashboard: image

joaoluis-pdm commented 2 years ago

Meeting 2021-09-28:

"My Application" -> "My Referrals"

Sponsors cannot see patient application details.

joaoluis-pdm commented 2 years ago

@pccosta-pdm commit d90a0c9 seems to work. Review complete. Thanx!

joaoluis-pdm commented 2 years ago

(Low-priprity) @pccosta-pdm can you please add UI to sort by columns on component https://github.com/PharmaLedger-IMI/ctr-workspace/tree/master/ctr-backoffice-frontend/src/app/application ?

Note that the same component is used on 2 pages at least, with a different number of columns displayed ( /application-clinicalsite ApplicationComponent and /clinicaltrial-clinicalsite ClinicalTrialDetailClinicalSiteComponent )

Is needed, change/extend https://github.com/PharmaLedger-IMI/ctr-workspace/blob/master/ctr-backoffice-backend/src/ctrial/application.repository.ts and applicationquery.validator.ts

joaoluis-pdm commented 2 years ago

Also, @pccosta-pdm , please remove the writing of the "Application" to the blockchain.

pccosta-pdm commented 2 years ago

@joaoluis-pdm done!

joaoluis-pdm commented 2 years ago

Multi-site changes handled within #14. Available on v0.10.3

joaoluis-pdm commented 2 years ago

Meeting 2021-09-28 CTR Weekly: Ask for phone number.

joaoluis-pdm commented 2 years ago

Patient phone number must be filled manually, as it is not part of the patient wallet information.

joaoluis-pdm commented 2 years ago

From the weekly business meetings, there is a request to add a "status" attribute

Adding a "status" attribute will raise the need to define a workflow (what are the possible statuses, and what can be done at each status).

To avoid that, the tech team simply counter-proposes the export of this data to CSV, and let the application processing workflow be external to the software.

joaoluis-pdm commented 2 years ago

Using https://www.npmjs.com/package/mat-table-exporter

This exports the mat-table as seen on screen - for many applicants that will usually involve expanding the number of items displayed.

joaoluis-pdm commented 2 years ago

Meeting 2022-01-04

On the Clinical Site App, rename wording of "Application" -> to "Referrals".

joaoluis-pdm commented 2 years ago

Meeting 2022-01-04

The Export-to-CSV needs to export the whole table, not only the visible results, so b284c85 should do that (instead of depending on https://www.npmjs.com/package/mat-table-exporter )