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

v3.13-beta #331

Merged
merged 10 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@
if Config.ENV != NoHarmENV.PRODUCTION.value:
logging.basicConfig()
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
logging.getLogger("noharm.backend").setLevel(logging.DEBUG)


@app.route("/version", methods=["GET"])
def getVersion():
return {"status": "success", "data": "v3.12-beta"}, status.HTTP_200_OK
return {"status": "success", "data": "v3.13-beta"}, status.HTTP_200_OK


@app.route("/exc", methods=["GET"])
Expand Down
21 changes: 21 additions & 0 deletions models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class PrescriptionAuditTypeEnum(Enum):
UNDO_REVISION = 4
INTEGRATION_CLINICAL_NOTES = 5
INTEGRATION_PRESCRIPTION_RELEASE = 6
UPSERT_CLINICAL_NOTES = 7


class PrescriptionDrugAuditTypeEnum(Enum):
Expand Down Expand Up @@ -132,3 +133,23 @@ class NifiQueueActionTypeEnum(Enum):
CLEAR_STATE = "CLEAR_STATE"
TERMINATE_PROCESS = "TERMINATE_PROCESS"
CUSTOM_CALLBACK = "CUSTOM_CALLBACK"


class DrugAlertTypeEnum(Enum):
KIDNEY = "kidney"
LIVER = "liver"
PLATELETS = "platelets"
ELDERLY = "elderly"
TUBE = "tube"
ALLERGY = "allergy"
MAX_TIME = "maxTime"
MAX_DOSE = "maxDose"
IRA = "ira"
PREGNANT = "pregnant"
LACTATING = "lactating"


class DrugAlertLevelEnum(Enum):
LOW = "low"
MEDIUM = "medium"
HIGH = "high"
2 changes: 2 additions & 0 deletions models/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class Relation(db.Model):
sctidb = db.Column("sctidb", db.BigInteger, primary_key=True)
kind = db.Column("tprelacao", db.String(2), primary_key=True)
text = db.Column("texto", db.String, nullable=True)
level = db.Column("nivel", db.String, nullable=True)
active = db.Column("ativo", db.Boolean, nullable=True)
update = db.Column("update_at", db.DateTime, nullable=True)
user = db.Column("update_by", db.BigInteger, nullable=True)
Expand Down Expand Up @@ -146,6 +147,7 @@ def findBySctid(sctid, user):
"type": r[0].kind,
"text": r[0].text,
"active": r[0].active,
"level": r[0].level,
"editable": bool(r[0].creator == user.id)
or (not User.permission(user)),
}
Expand Down
13 changes: 12 additions & 1 deletion models/prescription.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,18 @@ def getPatients(

if len(indicators) > 0:
for i in indicators:
q = q.filter(Prescription.features["alertStats"][i].as_integer() > 0)
interactions = ["it", "dt", "dm", "iy", "sl", "rx"]
if i in interactions:
q = q.filter(
Prescription.features["alertStats"]["interactions"][
i
].as_integer()
> 0
)
else:
q = q.filter(
Prescription.features["alertStats"][i].as_integer() > 0
)

if len(drugAttributes) > 0:
for a in drugAttributes:
Expand Down
Loading
Loading