From 870f6ffee2833c6d4ebb79518ff9eac4fa00f453 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Fri, 26 Jan 2024 22:01:34 -0800 Subject: [PATCH 1/3] added test to verify that wizard resource creation works correctly. update fasten-sources (contains fix for silently ignoring failures during wizard resource creation). fixed file upload error in wizard. Fixed data structure error in wizard for DocumentReference. fixes #393 --- backend/pkg/web/handler/account.go | 2 +- .../pkg/web/handler/resource_related_test.go | 143 ++++++++++++++++++ backend/pkg/web/handler/testdata/related.json | 69 +++++++++ ...ecord-wizard-add-attachment.component.html | 2 +- ...-record-wizard-add-attachment.component.ts | 7 +- .../medical-record-wizard.utilities.ts | 13 +- .../medical-sources.component.html | 2 +- .../assets/favicon/android-chrome-300x300.png | Bin 0 -> 10622 bytes go.mod | 2 +- go.sum | 4 +- 10 files changed, 228 insertions(+), 16 deletions(-) create mode 100644 backend/pkg/web/handler/resource_related_test.go create mode 100644 backend/pkg/web/handler/testdata/related.json create mode 100644 frontend/src/assets/favicon/android-chrome-300x300.png diff --git a/backend/pkg/web/handler/account.go b/backend/pkg/web/handler/account.go index c90aad644..453cb959a 100644 --- a/backend/pkg/web/handler/account.go +++ b/backend/pkg/web/handler/account.go @@ -8,7 +8,7 @@ import ( "net/http" ) -// SECURITY: this is a secure endpoint, and should only be called after a double confirmation +// UX: this is a secure endpoint, and should only be called after a double confirmation func DeleteAccount(c *gin.Context) { logger := c.MustGet(pkg.ContextKeyTypeLogger).(*logrus.Entry) databaseRepo := c.MustGet(pkg.ContextKeyTypeDatabase).(database.DatabaseRepository) diff --git a/backend/pkg/web/handler/resource_related_test.go b/backend/pkg/web/handler/resource_related_test.go new file mode 100644 index 000000000..944b20a89 --- /dev/null +++ b/backend/pkg/web/handler/resource_related_test.go @@ -0,0 +1,143 @@ +package handler + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/fastenhealth/fasten-onprem/backend/pkg" + mock_config "github.com/fastenhealth/fasten-onprem/backend/pkg/config/mock" + "github.com/fastenhealth/fasten-onprem/backend/pkg/database" + "github.com/fastenhealth/fasten-onprem/backend/pkg/event_bus" + "github.com/fastenhealth/fasten-onprem/backend/pkg/models" + "github.com/gin-gonic/gin" + "github.com/golang/mock/gomock" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + "io" + "io/ioutil" + "log" + "mime/multipart" + "net/http" + "net/http/httptest" + "os" + "testing" +) + +// Go through this page to understand how this file is structured. +// https://pkg.go.dev/github.com/stretchr/testify/suite#section-documentation + +// Define the suite, and absorb the built-in basic suite +// functionality from testify - including a T() method which +// returns the current testing context +type ResourceRelatedHandlerTestSuite struct { + suite.Suite + MockCtrl *gomock.Controller + TestDatabase *os.File + + AppConfig *mock_config.MockInterface + AppRepository database.DatabaseRepository + AppEventBus event_bus.Interface +} + +// BeforeTest has a function to be executed right before the test starts and receives the suite and test names as input +func (suite *ResourceRelatedHandlerTestSuite) BeforeTest(suiteName, testName string) { + suite.MockCtrl = gomock.NewController(suite.T()) + + dbFile, err := ioutil.TempFile("", fmt.Sprintf("%s.*.db", testName)) + if err != nil { + log.Fatal(err) + } + suite.TestDatabase = dbFile + + appConfig := mock_config.NewMockInterface(suite.MockCtrl) + appConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes() + appConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes() + appConfig.EXPECT().IsSet("database.encryption.key").Return(false).AnyTimes() + appConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes() + suite.AppConfig = appConfig + + appRepo, err := database.NewRepository(suite.AppConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer()) + suite.AppRepository = appRepo + + suite.AppEventBus = event_bus.NewNoopEventBusServer() + + appRepo.CreateUser(context.Background(), &models.User{ + Username: "test_username", + Password: "test", + }) + +} + +// AfterTest has a function to be executed right after the test finishes and receives the suite and test names as input +func (suite *ResourceRelatedHandlerTestSuite) AfterTest(suiteName, testName string) { + suite.MockCtrl.Finish() + os.Remove(suite.TestDatabase.Name()) +} + +// In order for 'go test' to run this suite, we need to create +// a normal test function and pass our suite to suite.Run +func TestResourceRelatedHandlerTestSuite(t *testing.T) { + suite.Run(t, new(ResourceRelatedHandlerTestSuite)) +} + +func (suite *ResourceRelatedHandlerTestSuite) TestResourceRelatedHandlerTestSuite() { + //setup + w := httptest.NewRecorder() + ctx, _ := gin.CreateTestContext(w) + ctx.Set(pkg.ContextKeyTypeLogger, logrus.WithField("test", suite.T().Name())) + ctx.Set(pkg.ContextKeyTypeDatabase, suite.AppRepository) + ctx.Set(pkg.ContextKeyTypeConfig, suite.AppConfig) + ctx.Set(pkg.ContextKeyTypeEventBusServer, suite.AppEventBus) + ctx.Set(pkg.ContextKeyTypeAuthUsername, "test_username") + + //test + relatedJsonForm, relatedJsonWriter := createMultipartFormData(suite.T(), "file", "testdata/related.json") // just pass the file name + relatedReq, err := http.NewRequest("POST", "/api/v1/resource/related", &relatedJsonForm) + // set the content type, this will contain the boundary. + relatedReq.Header.Set("Content-Type", relatedJsonWriter.FormDataContentType()) + ctx.Request = relatedReq + require.NoError(suite.T(), err) + + CreateRelatedResources(ctx) + + var responseWrapper models.ResponseWrapper + err = json.Unmarshal(w.Body.Bytes(), &responseWrapper) + require.NoError(suite.T(), err) + + summary := responseWrapper.Data.(map[string]interface{}) + + //assert + assert.EqualValues(suite.T(), http.StatusOK, w.Code) + assert.Equal(suite.T(), summary["TotalResources"], 3) + +} + +// https://stackoverflow.com/a/56696333/1157633 +func createMultipartFormData(t *testing.T, fieldName, fileName string) (bytes.Buffer, *multipart.Writer) { + var b bytes.Buffer + var err error + w := multipart.NewWriter(&b) + var fw io.Writer + file := mustOpen(fileName) + if fw, err = w.CreateFormFile(fieldName, file.Name()); err != nil { + t.Errorf("Error creating writer: %v", err) + } + if _, err = io.Copy(fw, file); err != nil { + t.Errorf("Error with io.Copy: %v", err) + } + w.Close() + return b, w +} + +func mustOpen(f string) *os.File { + r, err := os.Open(f) + if err != nil { + pwd, _ := os.Getwd() + fmt.Println("PWD: ", pwd) + panic(err) + } + return r +} diff --git a/backend/pkg/web/handler/testdata/related.json b/backend/pkg/web/handler/testdata/related.json new file mode 100644 index 000000000..b4d279b52 --- /dev/null +++ b/backend/pkg/web/handler/testdata/related.json @@ -0,0 +1,69 @@ +{ + "resourceType": "List", + "entry": [], + "encounter": { + "reference": "Encounter/4e4e6346-2350-47c0-ba73-ee0fdaf3a8a7" + }, + "contained": [ + { + "resourceType": "Encounter", + "id": "4e4e6346-2350-47c0-ba73-ee0fdaf3a8a7", + "serviceType": { + "id": "562", + "identifier": [ + { + "system": "http://terminology.hl7.org/CodeSystem/service-type", + "code": "562", + "display": "Test Message" + } + ], + "text": "Test Message" + }, + "status": "finished", + "participant": [], + "period": { + "start": "2024-01-04T08:00:00.000Z", + "end": "2024-01-27T08:00:00.000Z" + }, + "reasonReference": [], + "serviceProvider": {} + }, + { + "id": "4e2611e4-df0d-4dae-ad32-1c90537b32af", + "resourceType": "Binary", + "contentType": "application/pdf", + "data": "JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwogIC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAvTWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0KPj4KZW5kb2JqCgozIDAgb2JqCjw8CiAgL1R5cGUgL1BhZ2UKICAvUGFyZW50IDIgMCBSCiAgL1Jlc291cmNlcyA8PAogICAgL0ZvbnQgPDwKICAgICAgL0YxIDQgMCBSIAogICAgPj4KICA+PgogIC9Db250ZW50cyA1IDAgUgo+PgplbmRvYmoKCjQgMCBvYmoKPDwKICAvVHlwZSAvRm9udAogIC9TdWJ0eXBlIC9UeXBlMQogIC9CYXNlRm9udCAvVGltZXMtUm9tYW4KPj4KZW5kb2JqCgo1IDAgb2JqICAlIHBhZ2UgY29udGVudAo8PAogIC9MZW5ndGggNDQKPj4Kc3RyZWFtCkJUCjcwIDUwIFRECi9GMSAxMiBUZgooSGVsbG8sIHdvcmxkISkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iagoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4gCjAwMDAwMDAwNzkgMDAwMDAgbiAKMDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAwMDAwIG4gCjAwMDAwMDAzODAgMDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9vdCAxIDAgUgo+PgpzdGFydHhyZWYKNDkyCiUlRU9G" + }, + { + "id": "53066674-9e89-41e9-95d9-8eaf24b41ea6", + "resourceType": "DocumentReference", + "status": "current", + "category": [ + { + "coding": [ + { + "system": "http://loinc.org", + "code": "11488-4", + "display": "Consult Note" + } + ], + "text": "Consult Note" + } + ], + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "urn:uuid:4e2611e4-df0d-4dae-ad32-1c90537b32af", + "title": "test attachment" + } + } + ], + "context": { + "encounter": [{ + "reference": "Encounter/4e4e6346-2350-47c0-ba73-ee0fdaf3a8a7" + }] + } + } + ] +} diff --git a/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.html b/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.html index c086344c8..f5e978224 100644 --- a/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.html +++ b/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.html @@ -30,7 +30,7 @@
- +
diff --git a/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.ts b/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.ts index ed39600bd..c94ed3b49 100644 --- a/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.ts +++ b/frontend/src/app/components/medical-record-wizard-add-attachment/medical-record-wizard-add-attachment.component.ts @@ -41,15 +41,16 @@ export class MedicalRecordWizardAddAttachmentComponent implements OnInit { console.log("onAttachmentFileChange") let fileInput = $event.target as HTMLInputElement; if (fileInput.files && fileInput.files[0]) { + let processingFile = fileInput.files[0] let reader = new FileReader(); reader.onloadend = () => { // use a regex to remove data url part const base64String = (reader.result as string).replace('data:', '').replace(/^.+,/, ''); this.newAttachmentForm.get('file_content').setValue(base64String) }; - reader.readAsDataURL(fileInput.files[0]); - this.newAttachmentForm.get('file_name').setValue(fileInput.files[0].name) - this.newAttachmentForm.get('file_size').setValue(fileInput.files[0].size) + reader.readAsDataURL(processingFile); + this.newAttachmentForm.get('file_name').setValue(processingFile.name) + this.newAttachmentForm.get('file_size').setValue(processingFile.size) } } diff --git a/frontend/src/app/components/medical-record-wizard/medical-record-wizard.utilities.ts b/frontend/src/app/components/medical-record-wizard/medical-record-wizard.utilities.ts index 80569ee29..fbbd4ff40 100644 --- a/frontend/src/app/components/medical-record-wizard/medical-record-wizard.utilities.ts +++ b/frontend/src/app/components/medical-record-wizard/medical-record-wizard.utilities.ts @@ -371,13 +371,12 @@ function resourceAttachmentToR4DocumentReference(resourceStorage: ResourceStorag } } ], - context: [ - { - encounter: { - reference: generateReferenceUriFromResourceOrReference(encounterResource) //Encounter - }, - } - ] + context: { + encounter: [{ + reference: generateReferenceUriFromResourceOrReference(encounterResource) //Encounter + }], + } + // date: `${new Date(resourceDocumentReference.date.year,resourceDocumentReference.date.month-1,resourceDocumentReference.date.day).toISOString()}`, } as DocumentReference resourceStorage['DocumentReference'][documentReferenceResource.id] = documentReferenceResource diff --git a/frontend/src/app/pages/medical-sources/medical-sources.component.html b/frontend/src/app/pages/medical-sources/medical-sources.component.html index ed1266e23..dcc3390ba 100644 --- a/frontend/src/app/pages/medical-sources/medical-sources.component.html +++ b/frontend/src/app/pages/medical-sources/medical-sources.component.html @@ -19,7 +19,7 @@

In Sandbox mode Fasten Health cannot access real patient information. You must use Sandbox credentials when authenticating to healthcare sources. - These credentials are available on Github + These credentials are available in our Sandbox Guide diff --git a/frontend/src/assets/favicon/android-chrome-300x300.png b/frontend/src/assets/favicon/android-chrome-300x300.png new file mode 100644 index 0000000000000000000000000000000000000000..c5ae4f845edd755808d741ca880cb7b488784b46 GIT binary patch literal 10622 zcmeHtg;!M3*Y*Gd3<%O8-5}jDARyfWN=bKvz|fr{-5?>QNDK`F(jn!L(v2V?-4X)d z^_SoGAAIXw@11qmIrrS>?7h!f`#f{*+54TQh9WLD1vUr-!c|t1(*}W1IRD-d44}m~ zFu@Zjz_!oTpMyZPiI4u6qXW-$mP*>{Adnvm2ow?l0^I;jAv++DCoc%JYX$;Avp^uS zH@PiZ62OZHYkg%Kb#)LsP=|ofQ3ye3Kn(@>flw$wf29F6kO~Urf9l#OZ2!WbfBIEZ)u5KH&fMl!t`^qZKF)9c_5w-xK!K{WHO!pO$Jxon1M2gP;U5Sn zQ2*P^!$9{B2+Z*rgTA^Zovf?7HJvawFE=lPBsLu#orJrU4OClB;a}Z>r)LayFxVR? z50AIEH@CL{x2wA?51*Kr7!NN$4?jN_fZ+1*b%B}taJhIe{!_@m<;YokSi0N4f!Vvd z(EXKbZsF<)d&a=S&<^)7M?*)WuFzAO-We=b%;PM9VORvA9s4{UT4 z8T3-rR!H}fyc4fkm$2|$zghT6B$wqp6z=G``dV3h^7^55Te*0|#nHz5^KJY4hl=cj z`Cof`tG{nnSN-o2*cAAg3Gh(}AR*FEL6p`-kmwKy6PQW=8-#%lwHrUl41I(B2|FqS zUAH#PUszNKn1ftzNE7ITm2nyZiI(OC(A~`{Q86J9rJ6KMIcabhJzY0;zYhN^u$*+* zCkZ-K27DY8EM4BJltMr#A?GFv0e+|%fDUs@$00!>NHTkh2dD+hN{5leRalh*Hh@)q zrNMG^F%`|vgJkeUIo3OyTj2PF4w8Y&K&wJdPm#&L@KTv z|G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;as_Mv*A)%!0aS^qPLyOO6t5-@@E0+_kvhb_d3pfC9zc{N+hYR6SOjoc z3`6z5%nO?qB GVgCot!{C(w literal 0 HcmV?d00001 diff --git a/go.mod b/go.mod index bdb384084..c3c331ab1 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/dave/jennifer v1.6.1 github.com/dominikbraun/graph v0.15.0 github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 - github.com/fastenhealth/fasten-sources v0.5.5 + github.com/fastenhealth/fasten-sources v0.5.6 github.com/fastenhealth/gofhir-models v0.0.6 github.com/gin-gonic/gin v1.9.0 github.com/go-gormigrate/gormigrate/v2 v2.1.1 diff --git a/go.sum b/go.sum index 7678d3bcc..f1e1a216f 100644 --- a/go.sum +++ b/go.sum @@ -101,8 +101,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fastenhealth/fasten-sources v0.5.5 h1:+vOIG7R/J7QxEZrrfPFfaBzqYU5eDu7x/bc/cgOjvW4= -github.com/fastenhealth/fasten-sources v0.5.5/go.mod h1:hUQATAu5KrxKbACJoVt4iEKIGnRtmiOmHz+5TLfyiCM= +github.com/fastenhealth/fasten-sources v0.5.6 h1:F4Qmw9ABLSkqkWncoSnChBRDVWLrzkJv+z4z/Ue/fdc= +github.com/fastenhealth/fasten-sources v0.5.6/go.mod h1:hUQATAu5KrxKbACJoVt4iEKIGnRtmiOmHz+5TLfyiCM= github.com/fastenhealth/gofhir-models v0.0.6 h1:yJYYaV1eJtHiGEfA1rXLsyOm/9hIi6s2cGoZzGfW1tM= github.com/fastenhealth/gofhir-models v0.0.6/go.mod h1:xB8ikGxu3bUq2b1JYV+CZpHqBaLXpOizFR0eFBCunis= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= From 78a1935d13641d2968b742bbe3b4397d65ebf44d Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Mon, 29 Jan 2024 14:23:49 -0800 Subject: [PATCH 2/3] fixed test for related count. --- backend/pkg/web/handler/resource_related_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/pkg/web/handler/resource_related_test.go b/backend/pkg/web/handler/resource_related_test.go index 944b20a89..a215f4dcd 100644 --- a/backend/pkg/web/handler/resource_related_test.go +++ b/backend/pkg/web/handler/resource_related_test.go @@ -111,7 +111,7 @@ func (suite *ResourceRelatedHandlerTestSuite) TestResourceRelatedHandlerTestSuit //assert assert.EqualValues(suite.T(), http.StatusOK, w.Code) - assert.Equal(suite.T(), summary["TotalResources"], 3) + assert.Equal(suite.T(), summary["TotalResources"], float64(3)) } From b1c9fec7e8c7e844fc6e2872085f8b03b591dd1b Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Mon, 29 Jan 2024 14:24:08 -0800 Subject: [PATCH 3/3] better error message or callback --- .../medical-sources-connected.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/components/medical-sources-connected/medical-sources-connected.component.ts b/frontend/src/app/components/medical-sources-connected/medical-sources-connected.component.ts index 4508b58db..9f5e2ec5b 100644 --- a/frontend/src/app/components/medical-sources-connected/medical-sources-connected.component.ts +++ b/frontend/src/app/components/medical-sources-connected/medical-sources-connected.component.ts @@ -124,7 +124,7 @@ export class MedicalSourcesConnectedComponent implements OnInit { //TOOD: print this message in the UI let errMsg = "an error occurred while authenticating to this source. Please try again later" console.error(errMsg, callbackErrorDescription) - throw new Error(errMsg) + throw new Error(`callback error: ${callbackError}, description: ${callbackErrorDescription}`) } console.log("callback code:", callbackCode)