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

OH2-389 | Provide operation context #477

Merged

Conversation

SteveGT96
Copy link
Contributor

@SteveGT96 SteveGT96 commented Oct 7, 2024

See OH2-389
Paired with #1427

@mwithi
Copy link
Member

mwithi commented Oct 7, 2024

Are these breaking changes all intentional?

Error: in API POST /admissions added the new required request property 'operation/opeFor'
Error: in API PUT /admissions added the new required request property 'operation/opeFor'
Error: in API POST /admissions/discharge added the new required request property 'operation/opeFor'
Error: in API POST /malnutritions added the new required request property 'admission/operation/opeFor'
Error: in API PUT /malnutritions added the new required request property 'admission/operation/opeFor'
Error: in API POST /opds/rows added the new required request property 'operationRows/items/admission/operation/opeFor'
Error: in API POST /opds/rows added the new required request property 'operationRows/items/operation/opeFor'
Error: in API PUT /opds/rows/{code} added the new required request property 'operationRows/items/admission/operation/opeFor'
Error: in API PUT /opds/rows/{code} added the new required request property 'operationRows/items/operation/opeFor'
Error: in API POST /operations added the new required request property 'opeFor'
Error: in API POST /operations/rows added the new required request property 'admission/operation/opeFor'
Error: in API POST /operations/rows added the new required request property 'operation/opeFor'
Error: in API PUT /operations/rows added the new required request property 'admission/operation/opeFor'
Error: in API PUT /operations/rows added the new required request property 'operation/opeFor'
Error: in API PUT /operations/{code} added the new required request property 'opeFor'

@SteveGT96
Copy link
Contributor Author

Are these breaking changes all intentional?

Error: in API POST /admissions added the new required request property 'operation/opeFor'
Error: in API PUT /admissions added the new required request property 'operation/opeFor'
Error: in API POST /admissions/discharge added the new required request property 'operation/opeFor'
Error: in API POST /malnutritions added the new required request property 'admission/operation/opeFor'
Error: in API PUT /malnutritions added the new required request property 'admission/operation/opeFor'
Error: in API POST /opds/rows added the new required request property 'operationRows/items/admission/operation/opeFor'
Error: in API POST /opds/rows added the new required request property 'operationRows/items/operation/opeFor'
Error: in API PUT /opds/rows/{code} added the new required request property 'operationRows/items/admission/operation/opeFor'
Error: in API PUT /opds/rows/{code} added the new required request property 'operationRows/items/operation/opeFor'
Error: in API POST /operations added the new required request property 'opeFor'
Error: in API POST /operations/rows added the new required request property 'admission/operation/opeFor'
Error: in API POST /operations/rows added the new required request property 'operation/opeFor'
Error: in API PUT /operations/rows added the new required request property 'admission/operation/opeFor'
Error: in API PUT /operations/rows added the new required request property 'operation/opeFor'
Error: in API PUT /operations/{code} added the new required request property 'opeFor'

Should I make opeFor optional ?

@mwithi
Copy link
Member

mwithi commented Oct 7, 2024

Should I make opeFor optional ?

no, I'm asking if you agree with the reported changes. Since they break many API, how we should proceed?
Should the same PR be linked to another PR with needed changes on the UI side in order to align its develop?
@SilverD3 wdyt too?

@SilverD3
Copy link
Contributor

SilverD3 commented Oct 8, 2024

@SilverD3 wdyt too?

Yes, we have to open an issue to align the FE.

Actually DTOs in the API aren't specific. Maybe later we should refactor the code and create DTO to return concise data requested by the API consumers.

For example, take a look at this DTO which is returned every time we're retrieving admissions:

{
  "id": 12,
  "admitted": 0,
  "type": "N",
  "ward": {
    "code": "str",
    "description": "string",
    "telephone": "string",
    "fax": "string",
    "email": "string",
    "beds": 0,
    "nurs": 0,
    "docs": 0,
    "visitDuration": 0,
    "lock": 0,
    "opd": true,
    "female": true,
    "male": true,
    "pharmacy": true
  },
  "patient": {
    "code": 0,
    "firstName": "Mario",
    "secondName": "Rossi",
    "name": "string",
    "birthDate": "1979-05-01",
    "age": 40,
    "agetype": "null",
    "sex": "M",
    "address": "Via Roma, 12",
    "city": "Verona",
    "nextKin": "string",
    "telephone": "+393456789012",
    "note": "Test insert new patient",
    "motherName": "Roberta",
    "mother": "A",
    "fatherName": "Giuseppe",
    "father": "D",
    "bloodType": "A+",
    "hasInsurance": "N",
    "parentTogether": "N",
    "taxCode": "RSSMRA79E01L781N",
    "lock": 0,
    "blobPhoto": [
      "string"
    ],
    "hashCode": 0,
    "allergies": "string",
    "anamnesis": "string",
    "status": "I",
    "consensusFlag": true,
    "consensusServiceFlag": true
  },
  "admDate": "string",
  "admType": {
    "code": "A",
    "description": "AMBULANCE"
  },
  "diseaseIn": {
    "code": "99",
    "description": "string",
    "diseaseType": {
      "code": "st",
      "description": "string"
    },
    "opdInclude": true,
    "ipdInInclude": true,
    "ipdOutInclude": true,
    "hashCode": 0,
    "lock": 0
  },
  "diseaseOut1": {
    "code": "99",
    "description": "string",
    "diseaseType": {
      "code": "st",
      "description": "string"
    },
    "opdInclude": true,
    "ipdInInclude": true,
    "ipdOutInclude": true,
    "hashCode": 0,
    "lock": 0
  },
  "diseaseOut2": {
    "code": "99",
    "description": "string",
    "diseaseType": {
      "code": "st",
      "description": "string"
    },
    "opdInclude": true,
    "ipdInInclude": true,
    "ipdOutInclude": true,
    "hashCode": 0,
    "lock": 0
  },
  "diseaseOut3": {
    "code": "99",
    "description": "string",
    "diseaseType": {
      "code": "st",
      "description": "string"
    },
    "opdInclude": true,
    "ipdInInclude": true,
    "ipdOutInclude": true,
    "hashCode": 0,
    "lock": 0
  },
  "operation": {
    "code": "string",
    "description": "string",
    "type": {
      "code": "st",
      "description": "string"
    },
    "opeFor": "opd_admission",
    "major": 0,
    "lock": 0
  },
  "opDate": "string",
  "opResult": "N",
  "disDate": "string",
  "disType": {
    "code": "SN",
    "description": "SORTIE NORMALE"
  },
  "note": "string",
  "transUnit": 0,
  "visitDate": "string",
  "pregTreatmentType": {
    "code": "string",
    "description": "string",
    "hashCode": 0
  },
  "deliveryDate": "string",
  "deliveryType": {
    "code": "N",
    "description": "ACCOUCHEMENT NORMAL"
  },
  "deliveryResult": {
    "code": "M",
    "description": "MORTALITÉ MATERNELLE"
  },
  "weight": 0,
  "ctrlDate1": "2024-10-08T13:49:26.253Z",
  "ctrlDate2": "2024-10-08T13:49:26.253Z",
  "abortDate": "2024-10-08T13:49:26.253Z",
  "userID": "string",
  "hashCode": 0,
  "lock": 0,
  "deleted": "N",
  "fhu": "string",
  "yprog": 0
}

We (FE) don't really need all those information every time we retrieve an admission.
So I think we should create simplified DTO to only return necessary information (keeping the possibility to get full information)

@mwithi
Copy link
Member

mwithi commented Oct 9, 2024

Yes, we have to open an issue to align the FE.

For these breaking changes you can just open a PR on the UI with same code (OH2-389) and needed changes

For new DTOs I think it could be done later with dedicated issues.

@SteveGT96
Copy link
Contributor Author

SteveGT96 commented Oct 9, 2024

Yes, we have to open an issue to align the FE.

For these breaking changes you can just open a PR on the UI with same code (OH2-389) and needed changes

For new DTOs I think it could be done later with dedicated issues.

It's a refactoring that is not particulary related to OH2-389. IMHO the discussion about that should be moved into a new issue or in slack.

@SilverD3
Copy link
Contributor

SilverD3 commented Oct 10, 2024

Tests on develop are failing because this PR is not merged. Let's merge this PR and open an issue to align the FE

@mwithi
Copy link
Member

mwithi commented Oct 10, 2024

Tests on develop are failing because this PR is not merged. Let's merge this PR and open an issue to align the FE

Please @SilverD3 can you open the issue?

@mwithi mwithi merged commit 54df140 into informatici:develop Oct 10, 2024
1 of 2 checks passed
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.

3 participants