csc302-spring-2021 / proj-DaTeam

CSC302 course project for DaTeam
https://dateam-frontend.herokuapp.com/
5 stars 2 forks source link

Db serializer added read and search #125

Closed otomn closed 3 years ago

otomn commented 3 years ago

Description

Checklist

QA Steps

  1. In .env, set DB_HOST=localhost
  2. In backend/ run
    npm run db:down
    npm run db:rm # begin with a clean database
    npm run db:up
    node build/DBTest.js
  3. Verified no error is printed and the search result is display correctly Note that the objects in the search result are not complete because partial is set to true
    20:11:49 connect(dateam@dateam); useCount: 8
    20:11:49 tx/start
    20:11:49 tx: begin
    20:11:49 tx: SELECT * FROM form,item WHERE (form.uid = item.uid)
    20:11:49 tx: commit
    20:11:49 tx/end; duration: .004, success: true
    20:11:49 disconnect(dateam@dateam)
    [
    SDCForm {
    children: [],
    formProperties: [],
    lineage: 'Covid-19-test',
    version: '7d9166',
    header: '<Header><Property type="meta" styleClass="copyright" order="410" propName="CopyrightHeader" val="(c) 2019 College of American Pathologists.  All rights reserved.  License required for use." /></Header>',
    footer: '<Footer><Property type="meta" styleClass="copyright" order="410" propName="CopyrightFooter" val="(c) 2019 College of American Pathologists.  All rights reserved.  License required for use." /></Footer>',
    uid: '5d5bb199-59e2-400e-9f16-2d1d4d0db106',
    id: 'covid-19-test-9405c3',
    title: 'Covid19Test',
    order: 1
    },
    SDCForm {
    children: [],
    formProperties: [],
    lineage: 'Covid-19-test',
    version: '541f8f',
    uid: '9086f693-f256-434a-bbd2-5b4f5eeeba20',
    id: 'covid-19-test-014837'
    }
    ]
    20:11:49 connect(dateam@dateam); useCount: 0
    20:11:49 tx/start
    20:11:49 tx: begin
    20:11:49 tx: SELECT * FROM formProperty WHERE (formId = '9086f693-f256-434a-bbd2-5b4f5eeeba20')
    20:11:49 tx: commit
    20:11:49 tx/end; duration: .004, success: true
    20:11:49 disconnect(dateam@dateam)
    [
    SDCFormProperty {
    name: 'OfficialName',
    propName: 'OfficialName',
    val: 'Covid 19 test',
    formId: '9086f693-f256-434a-bbd2-5b4f5eeeba20'
    },
    SDCFormProperty {
    name: 'GenericHeaderText',
    propName: 'GenericHeaderText',
    val: 'Covid 19 Preliminary Test',
    formId: '9086f693-f256-434a-bbd2-5b4f5eeeba20'
    }
    ]
tsmswifty commented 3 years ago

I see no errors, although my output is different to yours:

SDCForm {
  children: [
    SDCDisplayItem {
      children: [],
      id: 'display-479adc',
      title: 'Please fill out this form'
    },
    SDCSection {
      children: [
        SDCTextField {
          children: [],
          id: 'text-1c80ea',
          type: 'string'
        },
        SDCListField {
          children: [],
          id: 'list-45e5ab',
          maxSelections: 1,
          minSelections: 1,
          options: [
            SDCListFieldItem {
              children: [],
              id: 'listitem-4ae1980',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              title: 'optiont 0'
            },
            SDCListFieldItem {
              children: [],
              id: 'listitem-cf7ca81',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              title: 'optiont 1'
            },
            SDCListFieldItem {
              children: [],
              id: 'listitem-8866922',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              title: 'optiont 2'
            },
            SDCListFieldItem {
              children: [],
              id: 'listitem-974bcf3',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              title: 'optiont 3'
            }
          ]
        }
      ],
      id: 'section-881d98'
    }
  ],
  id: 'covid-19-test-c67cee',
  lineage: 'Covid-19-test',
  version: '75e028',
  formProperties: [
    SDCFormProperty {
      name: 'OfficialName',
      propName: 'OfficialName',
      val: 'Covid 19 test'
    },
    SDCFormProperty {
      name: 'GenericHeaderText',
      propName: 'GenericHeaderText',
      val: 'Covid 19 Preliminary Test'
    }
  ]
}
SDCForm {
  children: [
    SDCDisplayItem {
      children: [],
      id: 'display-badfca',
      title: 'Please fill out this form',
      order: 1,
      uid: 'ad90e6f5-1612-453a-b667-e9f77d8c0767'
    },
    SDCSection {
      children: [
        SDCTextField {
          children: [],
          id: 'text-1',
          type: 'int',
          order: 1,
          uid: '138d6bb9-b6c7-4bd3-acd4-f300cfa18747',
          title: 'Weight',
          textAfterResponse: 'kg'
        },
        SDCListField {
          children: [],
          id: 'list-1',
          maxSelections: 1,
          minSelections: 1,
          options: [
            SDCListFieldItem {
              children: [],
              id: 'list-1-0',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              order: 1,
              uid: '8c31a7bb-1200-48a4-a06e-68a091c821c8',
              title: 'option listitem-132f4f'
            },
            SDCListFieldItem {
              children: [],
              id: 'list-1-1',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              order: 1,
              uid: '08cdbd40-2e4c-498d-987e-34c5a8ebe660',
              title: 'option listitem-1dd36e'
            },
            SDCListFieldItem {
              children: [],
              id: 'list-1-2',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              order: 1,
              uid: '5fd6cf43-89dd-40c0-8fe2-871291726265',
              title: 'option listitem-8344b6'
            },
            SDCListFieldItem {
              children: [],
              id: 'list-1-3',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              order: 1,
              uid: '641750ed-7284-4d16-a3b6-f99840f0ebb1',
              title: 'option listitem-04c820'
            },
            SDCListFieldItem {
              children: [],
              id: 'list-1-t',
              selectionDeselectsSiblings: false,
              selectionDisablesChildren: false,
              order: 1,
              uid: '1c7ece4e-57f5-416c-b45e-75868bf48e90',
              title: 'option listitem-5fd7f9',
              textResponse: SDCTextField {
                children: [],
                id: 'listText',
                type: 'int',
                order: 1,
                uid: '39f814b2-437e-4e12-9258-dcf13d58e18a',
                title: 'Weight',
                textAfterResponse: 'kg'
              }
            }
          ],
          order: 1,
          uid: 'd8cf0633-336c-436f-aea5-6450ce5d7ec2',
          title: 'Multiple Choice list-d98d2e',
          lookupEndPoint: 'http://dateam.com/options/58e0f0f2-ab51-4aa4-9de0-ca9cefa1f099'
        }
      ],
      id: 'section-ddb6dd',
      order: 1,
      title: 'Main Section',
      uid: '753a3c2d-9269-4f08-8c95-6e7437a733ed'
    }
  ],
  id: 'covid-19-test-0a2a83',
  lineage: 'Covid-19-test',
  version: '206813',
  formProperties: [
    SDCFormProperty {
      name: 'OfficialName',
      propName: 'OfficialName',
      val: 'Covid 19 test',
      order: 1
    },
    SDCFormProperty {
      name: 'GenericHeaderText',
      propName: 'GenericHeaderText',
      val: 'Covid 19 Preliminary Test',
      order: 2
    }
  ],
  uid: '5d5bb199-59e2-400e-9f16-2d1d4d0db106',
  order: 1,
  title: 'Covid19Test',
  header: '<Header><Property type="meta" styleClass="copyright" order="410" propName="CopyrightHeader" val="(c) 2019 College of American Pathologists.  All rights reserved.  License required for use." /></Header>',
  footer: '<Footer><Property type="meta" styleClass="copyright" order="410" propName="CopyrightFooter" val="(c) 2019 College of American Pathologists.  All rights reserved.  License required for use." /></Footer>'
}
5d5bb199-59e2-400e-9f16-2d1d4d0db106
Patient { id: 'e26741', name: 'Ujash' }
39bf35b9-9696-4a1e-81f3-357d93030f2f
SDCFormResponse {
  answers: [
    SDCAnswer { responses: [ '5' ], questionID: 'text-1' },
    SDCAnswer { responses: [ 'list-1-t' ], questionID: 'list-1' },
    SDCAnswer {
      responses: [ 'response to the text field within list' ],
      questionID: 'listText'
    }
  ],
  formId: '5d5bb199-59e2-400e-9f16-2d1d4d0db106',
  patientID: '39bf35b9-9696-4a1e-81f3-357d93030f2f',
  uid: '88c1094c-d9d1-48ee-b55d-340b60eea3f8'
}