Skip to content

Commit

Permalink
Merge Develop to Staging v24.21.0 (#2168)
Browse files Browse the repository at this point in the history
* Update max_length for phone numbers to adhere to ITU-T E.164 standard (#2138)

* Update max_length for phone numbers to adhere to ITU-T E.164 standard

* Clean up an empty line

* Adds missing migrations

---------

Co-authored-by: rithviknishad <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>

* Adds support for doctors and nurses discussions threads in Discussion Notes (#2137)

* Adds support for doctors and nurses discussions threads in Discussion Notes

* switch to using small integer field

* updated and fixes based on test cases

* rebase migrations

* Remake migrations

---------

Co-authored-by: Vignesh Hari <[email protected]>

* Allow `audio/mp4` by default (#2094)

Co-authored-by: Vignesh Hari <[email protected]>

* Bump Dependencies (#2143)

* Vigneshhari/bump dependencies (#2145)

* Bump Dependencies

* Bump Dependencies

* Bump Dependencies

* Bump Dependencies

* Skip creating event group if all fields are null (#2134)

* ABDM M3 (#1829)

Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: Gigin George <[email protected]>

* Increase area of specialisation in doctors (#2102)

* update doctor types

* Add Migration

---------

Co-authored-by: Rithvik Nishad <[email protected]>
Co-authored-by: Gigin George <[email protected]>

* Added discharge patient filters (#2124)

* added discharge patient filters

* updated filters

---------

Co-authored-by: Vignesh Hari <[email protected]>

* converted investigation and investigation group data into JSON (#1912)

* converted investigation and investigation group data into JSON

* created json files for investigations and investigation_groups

* updated investigations.json

* fixed json data,command and migrations

* fixing migrations

* fixing lint issue

* update migrations

* update migrations

---------

Co-authored-by: Aakash Singh <[email protected]>

* Drops support for cloning previous log update (#2127)

* Drop support for cloning previous log update

* undo unrelated changes

---------

Co-authored-by: Vignesh Hari <[email protected]>

* Change devcontainer make up command to run after start (#2146)

Co-authored-by: Vignesh Hari <[email protected]>

* Removes unused `current_health` field from Daily Rounds (#2162)

Removes unused `current_health` from Daily Rounds

Co-authored-by: Vignesh Hari <[email protected]>

* Display users list based on user access limitation (#1742)

* Refactor get_queryset method in UserViewSet

* Used get_accessible_facilities instead of subquery
to fetch the facilities linked to the user

* fixed failing tests

* fix queryset

---------

Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: khavinshankar <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>

* adds missing merge migrations (#2169)

merge migrations

---------

Co-authored-by: Bodhish Thomas <[email protected]>
Co-authored-by: rithviknishad <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>
Co-authored-by: Rithvik Nishad <[email protected]>
Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: Khavin Shankar <[email protected]>
Co-authored-by: Gigin George <[email protected]>
Co-authored-by: Rashmik <[email protected]>
Co-authored-by: Shivank Kacker <[email protected]>
Co-authored-by: Prafful Sharma <[email protected]>
Co-authored-by: Gokulram A <[email protected]>
  • Loading branch information
12 people authored May 15, 2024
1 parent 0240be1 commit 5d0158d
Show file tree
Hide file tree
Showing 55 changed files with 4,393 additions and 660 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
}
},
"postCreateCommand": "echo 'eval \"$(direnv hook bash)\"' >> ~/.bashrc && cp .env.example .env",
"postAttachCommand": "make up",
"postStartCommand": "make up",
"forwardPorts": [8000, 9000, 4000]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,7 @@ secrets.sh
/.idea/modules.xml
/.idea/vcs.xml
/.idea/ruff.xml


# Redis
*.rdb
12 changes: 6 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ djangoql = "==0.17.1"
djangorestframework = "==3.14.0"
djangorestframework-simplejwt = "==5.3.1"
dry-rest-permissions = "==0.1.10"
drf-nested-routers = "==0.93.4"
drf-nested-routers = "==0.94.1"
drf-spectacular = "==0.26.4"
"fhir.resources" = "==6.5.0"
gunicorn = "==22.0.0"
Expand All @@ -36,18 +36,18 @@ newrelic = "==9.3.0"
pillow = "==10.3.0"
psycopg = "==3.1.18"
pycryptodome = "==3.20.0"
pydantic = "==1.10.12" # fix for fhir.resources < 7.0.2
pydantic = "==1.10.15" # fix for fhir.resources < 7.0.2
pyjwt = "==2.8.0"
python-slugify = "==8.0.1"
pywebpush = "==1.14.0"
redis = {extras = ["hiredis"], version = "<5.0.0"} # constraint for redis-om
requests = "==2.31.0"
sentry-sdk = "==1.30.0"
whitenoise = "==6.5.0"
whitenoise = "==6.6.0"
redis-om = "==0.2.1"

[dev-packages]
black = "==24.3.0"
black = "==24.4.2"
boto3-stubs = {extras = ["s3", "boto3"], version = "==1.34.84"}
coverage = "==7.4.0"
debugpy = "==1.8.1"
Expand All @@ -60,14 +60,14 @@ djangorestframework-stubs = "==3.14.2"
factory-boy = "==3.3.0"
flake8 = "==7.0.0"
freezegun = "==1.2.2"
ipython = "==8.15.0"
ipython = "==8.24.0"
isort = "==5.12.0"
mypy = "==1.9.0"
pre-commit = "==3.4.0"
requests-mock = "==1.12.1"
tblib = "==2.0.0"
watchdog = "==3.0.0"
werkzeug = "==2.3.8"
werkzeug = "==3.0.3"

[docs]
furo = "==2023.9.10"
Expand Down
621 changes: 311 additions & 310 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions aws/backend.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
"name": "CURRENT_DOMAIN",
"value": "https://care.ohc.network"
},
{
"name": "BACKEND_DOMAIN",
"value": "https://careapi.ohc.network"
},
{
"name": "DJANGO_ADMIN_URL",
"value": "w8BYTTYRkxqAsbS2iU9Yd2ZgQy6D3uws"
Expand Down
8 changes: 8 additions & 0 deletions aws/celery.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"name": "CURRENT_DOMAIN",
"value": "https://care.ohc.network"
},
{
"name": "BACKEND_DOMAIN",
"value": "https://careapi.ohc.network"
},
{
"name": "DJANGO_ADMIN_URL",
"value": "w8BYTTYRkxqAsbS2iU9Yd2ZgQy6D3uws"
Expand Down Expand Up @@ -307,6 +311,10 @@
"name": "CURRENT_DOMAIN",
"value": "https://care.ohc.network"
},
{
"name": "BACKEND_DOMAIN",
"value": "https://careapi.ohc.network"
},
{
"name": "DJANGO_ADMIN_URL",
"value": "w8BYTTYRkxqAsbS2iU9Yd2ZgQy6D3uws"
Expand Down
33 changes: 33 additions & 0 deletions care/abdm/api/serializers/consent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from rest_framework import serializers

from care.abdm.api.serializers.abhanumber import AbhaNumberSerializer
from care.abdm.models.consent import ConsentArtefact, ConsentRequest
from care.users.api.serializers.user import UserBaseMinimumSerializer


class ConsentArtefactSerializer(serializers.ModelSerializer):
id = serializers.CharField(source="external_id", read_only=True)

class Meta:
model = ConsentArtefact
exclude = (
"deleted",
"external_id",
"key_material_private_key",
"key_material_public_key",
"key_material_nonce",
"key_material_algorithm",
"key_material_curve",
"signature",
)


class ConsentRequestSerializer(serializers.ModelSerializer):
id = serializers.CharField(source="external_id", read_only=True)
patient_abha_object = AbhaNumberSerializer(source="patient_abha", read_only=True)
requester = UserBaseMinimumSerializer(read_only=True)
consent_artefacts = ConsentArtefactSerializer(many=True, read_only=True)

class Meta:
model = ConsentRequest
exclude = ("deleted", "external_id")
12 changes: 8 additions & 4 deletions care/abdm/api/viewsets/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def post(self, request, *args, **kwargs):
data["hiRequest"]["keyMaterial"]["nonce"],
)

AbdmGateway().data_transfer(
data_transfer_response = AbdmGateway().data_transfer(
{
"transaction_id": data["transactionId"],
"data_push_url": data["hiRequest"]["dataPushUrl"],
Expand All @@ -306,11 +306,11 @@ def post(self, request, *args, **kwargs):
],
"data": cipher.encrypt(
Fhir(
PatientConsultation.objects.get(
PatientConsultation.objects.filter(
external_id=context[
"careContextReference"
]
)
).first()
).create_record(record)
)["data"],
},
Expand All @@ -332,7 +332,7 @@ def post(self, request, *args, **kwargs):
"parameters": "Curve25519/32byte random key",
"keyValue": cipher.key_to_share,
},
"nonce": cipher.sender_nonce,
"nonce": cipher.internal_nonce,
},
}
)
Expand All @@ -345,6 +345,10 @@ def post(self, request, *args, **kwargs):
],
"consent_id": data["hiRequest"]["consent"]["id"],
"transaction_id": data["transactionId"],
"session_status": "TRANSFERRED"
if data_transfer_response
and data_transfer_response.status_code == 202
else "FAILED",
"care_contexts": list(
map(
lambda context: {"id": context["careContextReference"]},
Expand Down
Loading

0 comments on commit 5d0158d

Please sign in to comment.