Skip to content

Commit

Permalink
Merge pull request #331 from noharm-ai/develop
Browse files Browse the repository at this point in the history
v3.13-beta
  • Loading branch information
marceloarocha authored Jul 10, 2024
2 parents 5782e5c + 90cfdb4 commit 59af5c2
Show file tree
Hide file tree
Showing 11 changed files with 1,206 additions and 546 deletions.
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

0 comments on commit 59af5c2

Please sign in to comment.