This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from odonto.models import Demographics | |
from odonto.episode_categories import FP17Episode | |
from opal.models import Episode | |
from dateutil.relativedelta import relativedelta | |
import datetime | |
from odonto import episode_categories | |
from odonto.odonto_submissions import models | |
def dupe_nhs_numbers(episode): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NorthEast | |
current seats | |
BREXIT_PARTY=2, LAB=1 | |
current votes | |
BREXIT_PARTY=36.8%, LAB=30.0%, LIB_DEM=11.3%, CON=8.5%, GREEN=5.0%, CHANGE_UK=4.0%, UKIP=3.3% | |
worst result: seats | |
BREXIT_PARTY=2, LAB=1, CHANGE_UK=0, GREEN=0, LIB_DEM=0 | |
worst result: votes | |
BREXIT_PARTY=36.8%, LAB=30.0%, LIB_DEM=18.4%, CON=8.5%, UKIP=3.3%, GREEN=1.9%, CHANGE_UK=0.0% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
from collections import defaultdict | |
def calculate_seats(_party_dict, seat_number): | |
""" | |
takes in the parties as a dictionary to % of vote | |
returns a dictionary of the parties to seat numbers | |
""" | |
party_dict = copy.copy(_party_dict) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"micro_test_leishmaniasis_pcr": [ | |
{ | |
"synonyms": [], | |
"name": "Leishmaniasis PCR" | |
}, | |
{ | |
"synonyms": [], | |
"name": "Malaria PCR" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from lab import models | |
from opal.models import Patient | |
import csv | |
def get_demographics_dict(patient): | |
result = {} | |
demographics = patient.demographics_set.first() | |
result["name"] = "{} {}".format(demographics.first_name, demographics.surname) | |
result["hospital_number"] = demographics.hospital_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
accountsservice, 0.6.29-1ubuntu8 | |
adduser, 3.113+nmu3ubuntu1 | |
apparmor, 2.8.0-0ubuntu11 | |
apt, 0.9.7.7ubuntu4 | |
apt-transport-https, 0.9.7.7ubuntu4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Compare | |
""" | |
test = [[c for c in p.split(' ') if c] for p in open('test.pkg', 'r').readlines() if p != '\n'] | |
prod = [[c for c in p.split(' ') if c] for p in open('prod.pkg', 'r').readlines() if p != '\n'] | |
prodversions = {} | |
for p in prod: | |
prodversions[p[1]] = p[2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lab.models import LabTest | |
from opal.models import Patient | |
from collections import defaultdict | |
from django.db import transaction | |
def get_problematic_lab_tests(): | |
all_lab_tests = LabTest.objects.all() | |
by_patient_bloodtest = defaultdict(list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import json | |
def read_date(line): | |
dt = line[line.index('[') + 1: line.index(']')] | |
dt = dt.split(" ")[0] | |
return datetime.strptime(dt, '%d/%b/%Y:%H:%M:%S') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# ./deploy_prod.sh $branch_name $previous_branch_name | |
# | |
fab clone_branch:$1 2>1 | tee /usr/lib/ohc/deployment.log | |
cd /usr/lib/ohc/elcidrfh-$1 | |
fab deploy_prod:$2 2>1 | tee /usr/lib/ohc/deployment.log |