You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
9.1 KiB
34 lines
9.1 KiB
org_names = ["Optivo", "1625 Independent People Ltd.", "A2DOMINION HOMES", "A2DOMINION SOUTH HA Ltd", "Abri Group Ltd.", "Accent Housing Ltd.", "Access Community Trust", "Accomplish Group", "ACKEE HOUSING PROJECT", "ACTION HOMELESS - LEICESTER", "Action Housing and Support Limited", "ADDICTION RECOVERY AGENCY", "ADULLAM HOMES HA Ltd.", "AKSA HA LTD", "Alabare Christian Care and Support", "AMADUDU", "Amicus Trust Ltd.", "ANAH PROJECT", "ANCHOR HANOVER", "ARCHES HOUSING ASSOCIATION LTD.", "ASHA ASIAN WOMENS AID", "ASHIANA", "Association for Spinal Injury Research, Rehabilitation and Reintegration (ASPIRE)", "Aster Communities", "Back on Track Housing", "BANGLA HOUSING ASSOCIATION", "BARNARDOS", "Basildon District Council", "Bassetlaw District Council", "Bernicia", "BEYOND HOUSING", "Birmingham City Council", "Blackburn YMCA (T/A Y Housing)", "BOURNVILLE ALMSHOUSE TRUST", "BOURNVILLE VILLAGE TRUST", "BOURNVILLE WORKS HS Ltd", "BPHA Ltd", "Bradford Cyrenians", "BRENT, WANDSWORTH & WESTMINSTER MIND", "Bridge Mental Health", "Brighter Places", "Bushbury Hill Estate Management Board", "CALICO HOUSING ASSOCIATION", "CAMBRIDGE CYRENIANS", "Caring for Communities and People (CCP)", "Catalyst Housing Ltd.", "Causeway Irish Housing", "CAYSH", "CENTRAL & CECIL HT", "CENTREPOINT", "Certitude (Support for Living)", "Change, Grow, Live", "Changing Lives", "Chartford Housing Limited", "CHELMER HOUSING PARTNERSHIP", "CHERRYTREE SUPPORT SERVICES LTD.", "Cheshire West and Chester Council", "Chorley Community Housing", "Chorus Homes", "City of Bradford Metropolitan District Council", "Clarion Housing Group", "COASTLINE HOUSING", "COMMUNITY LINKS", "CONNECT HOUSING", "Connection Support", "COTMAN HA Ltd", "COVENTRY CYRENIANS", "COVENTRY MIND", "Coventry Refugee and Migrant Centre", "CRANSTOUN DRUG SERVICES", "CREATIVE SUPPORT", "CROSBY HA Ltd", "CROWN SIMMONS HOUSING", "CROYDON CHURCHES HA Ltd", "Curo Choice Ltd", "Curo Places", "DEPAUL UK", "DERWENT HA Ltd", "Dovecotes TMO Ltd", "East Riding of Yorkshire Council", "emh homes", "Evolve Housing and Support", "Expect Ltd.", "FAMILY HELP", "FAMILY MOSAIC HOUSING", "FLAGSHIP HOUSING GROUP LTD", "Forhousing", "FOUNDATION HOUSING (Leeds)", "FRAMEWORK HA", "Funding Affordable Homes Housing Association Ltd.", "FYLDE COAST WOMEN'S AID", "GATEWAY HOUSING ASSOCIATION", "Genesis HA", "GIPSIL", "Gloucester City Homes", "GLOUCESTERSHIRE RURAL HOUSING ASSOCIATION LTD. (GRHA)", "GRAND UNION HOUSING GROUP", "GRAVESEND CHURCHES HA Ltd", "Great Places Housing Association", "GreenSquare Accord", "GreenSquare Group", "Grimsby and Cleethorpes Area Doorstep", "HALTON YMCA", "Harbour Support Services", "HARROGATE FLOWER FUND HOMES", "Harrogate Housing Association Limited", "HAVEBURY HOUSING PARTNERSHIP", "Heart of Medway Housing Association Ltd", "HESTIA HOUSING AND SUPPORT", "HEXAGON HA", "Hightown Housing Association Limited", "HINCKLEY HOMELESS", "HITS HOMES TRUST", "HOME GROUP [1199]", "Homeless Link [software company]", "Homeless Oxfordshire Ltd.", "Honeycomb Charitable Services Ltd.", "Honeycomb Group Ltd.", "HORTON HOUSING ASSOCIATION", "Housing and Care 21", "HOUSING FOR WOMEN", "HUDDERSFIELD WOMEN'S AID", "HULL & EAST YORKSHIRE MIND", "Humankind", "HUNDRED HOUSES SOCIETY", "HYDE HA Group", "HYNDBURN HOMES", "I Choose Freedom", "Imagine Mental Health", "IMPACT HOUSING ASSOCIATION", "Impakt Housing and Support", "Incommunities", "IRWELL VALLEY HA Ltd", "ISLINGTON & SHOREDITCH HA Ltd", "Jigsaw Homes North", "Jigsaw Homes Tameside", "Karbon Homes", "KIRKLEES ASIAN AND BLACK WOMEN'S WELFARE ASSOCIATION (KABWWA)", "KURDISH HA", "Lancashire Mind", "Latin American Women's Aid Refuge (LAWA)", "LDN London", "LEEDS FEDERATED HOUSING ASSOCIATION", "LEEDS WOMEN'S AID", "Legal & General Affordable Homes", "LEICESTER HA Ltd", "Leicestershire Rural Housing Association", "Lewisham Homes", "LIFE CARE AND HOUSING TRUST", "LiveWest Homes Ltd.", "LONDON & QUADRANT", "LONDON AND QUADRANT (L&Q) HOUSING TRUST", "London Borough of Hounslow", "London Borough of Lewisham", "Longhurst & Havelok Homes Ltd", "LOOK AHEAD CARE, SUPPORT AND HOUSING", "MANNINGHAM HA LTD", "MARSHA PHOENIX MEMORIAL TRUST", "MARTLET HOMES Ltd", "MCCH", "MERLIN HOUSING SOCIETY", "METROPOLITAN HOME OWNERSHIP Ltd.", "METROPOLITAN HOUSING TRUST LTD.", "MHS HOMES LTD", "MIDLAND HEART LTD.", "Milton Keynes Borough Council", "MISSING LINK", "MITRE HA Ltd", "MOAT HOMES Ltd", "Mosscare St Vincent's (MSV) Housing Group Ltd.", "MOUNT CARMEL", "NACRO", "Network Homes", "NEW HOPE", "NewArch Homes", "NEWLON HOUSING TRUST", "Next Link Housing", "Nomad Opening Doors", "North Kent MIND", "North Star Housing Group", "Northampton Domestic Abuse Service (NDAS)", "NORTHAMPTONSHIRE RURAL HOUSING ASSOCIATION", "NORTON HOUSING AND SUPPORT", "NOTTING HILL GENESIS", "NOTTING HILL HOME OWNERSHIP Ltd.", "Nottingham Community Housing Association Limited", "Nottinghamshire Women's Aid", "Oldham Metropolitan Borough Council", "Ongo Homes Limited", "Onward Homes", "ORBIT HOUSING ASSOCIATION LTD.", "ORIGIN HOUSING", "ORWELL HOUSING ASSOCIATION LTD.", "OUTLOOK CARE Ltd.", "OUTWARD HOUSING ASSOCIATION", "OXFORDSHIRE MIND", "P3", "PA Housing Limited", "PANAHGHAR", "Pathways to Independence Ltd.", "PEABODY TRUST", "PEAK DISTRICT RURAL HOUSING ASSOCIATION", "Personal Services Society (PSS)", "PHOENIX FUTURES", "Pinnacle Affordable Homes Ltd.", "Pinnacle Housing", "Pinnacle Spaces Ltd.", "PLACES FOR PEOPLE HOMES", "PLACES FOR PEOPLE LIVING+", "POPLAR HARCA Ltd.", "PRESENTATION HA Ltd", "Prima Group", "PROGRESS HOUSING ASSOCIATION LTD.", "RAVEN HOUSING TRUST", "REFUGE", "Regenda Homes", "ReSi Homes Ltd.", "ReSI Housing Limited", "RETHINK MENTAL ILLNESS", "RICHMOND FELLOWSHIP", "RIVERSIDE HOUSING GROUP", "Rooftop Housing Association Limited", "ROTHERHAM RISE", "ROUNDABOUT LTD.", "Royal Borough of Greenwich", "RUSH HOUSE", "SafeNet Domestic Abuse Service", "SAFERPLACES", "SALTASH HS LTD", "SALVATION ARMY", "SALVATION ARMY HA Ltd", "Sanctuary Affordable Housing Limited", "SANCTUARY HA", "SAXON WEALD", "SECOND STEP HA LTD", "Sheffield City Council", "SHEPHERD'S BUSH HA", "SINGLE HOMELESS PROJECT", "SINGLE PERSONS EMERG. ACCOMM IN RICHMOND (SPEAR)", "Solace Women's Aid", "SOUTH YORKSHIRE HA Ltd", "SOUTHDOWN HA", "SOUTHERN HOUSING", "SOUTHERN HOUSING HOME OWNERSHIP", "SOVEREIGN HA", "SPITALFIELDS CRYPT TRUST", "ST BASILS HA Ltd", "ST MICHAELS FELLOWSHIP", "St Mungo's", "Staying Put", "STOKE ON TRENT GINGERBREAD", "Stonewater Limited", "STONHAM HA Ltd", "STOPOVER", "STROUD BERESFORD LIMITED", "SUFFOLK MIND", "SWAN HA", "Swindon Women's Aid", "SYNERGY HOUSING LIMITED", "TARGET HA", "TAUNTON ASSN FOR THE HOMELESS HA Ltd", "THAMES REACH", "THAMES VALLEY CHARITABLE HA Ltd.", "The Albert Kennedy Trust", "The ExtraCare Charitable Trust", "The Guinness Partnership", "THE HAVEN WOLVERHAMPTON", "The Nehemiah Project", "THE OAKLEA TRUST", "The Square Building Trust Limited", "THE VILLAGES HA Ltd", "The Wish Centre", "The YOU Trust", "THRESHOLD HOUSING PROJECT", "THT and L&Q Community Limited (TLQCM)", "Thurrock Council", "Together for Mental Wellbeing", "Together Housing Group", "TOUCHSTONE", "TOWN AND COUNTRY HOUSING", "TRAFFORD HOUSING TRUST LTD", "TRANSFORM HOUSING AND SUPPORT", "Trinity Homeless Projects", "TUNTUM HA", "Turning Lives Around", "TURNING POINT", "TWO SAINTS", "TYNE HA", "UNITED RESPONSE", "UNITY HA LTD", "VALLEY HOUSE", "VIBRANCE", "VIRIDIAN HOUSING", "VIVID", "WANDLE HA Ltd", "WAY HA LTD", "Westlea Housing Association", "Wolverhampton City Council", "Wolverhampton Homes", "Women's Aid Bromley and Croydon", "Women's Aid Leicestershire Ltd.", "WOMEN'S PIONEER HOUSING Ltd.", "Wythenshawe Community Housing Group (WCHG)", "YMCA Brunel Group", "YMCA Downslink Group", "YMCA Fylde Coast", "YORKSHIRE HOUSING LIMITED", "Young Devon", "YOUNG WOMEN'S HOUSING PROJECT (YWHP)", "Your Housing Ltd.", "YWCA Yorkshire"] |
|
# fields = [:uprn, :uprn_known, :uprn_confirmed, :address_line1, :address_line2, :town_or_city, :county, :postcode_full, :la] |
|
fields = [:referral, :tenancylength] |
|
illness_fields = [:illness_type_1, :illness_type_2, :illness_type_3, :illness_type_4, :illness_type_5, :illness_type_6, :illness_type_7, :illness_type_8, :illness_type_9, :illness_type_10] |
|
|
|
def print_org_data(org_names, fields, illness_fields) |
|
i = 0 |
|
org_names.each do |org_name| |
|
i += 1 |
|
org = Organisation.find_by(name: org_name) |
|
if org.blank? |
|
p "#{i} of #{org_names.count}: Org #{org_name} not found, skipping" |
|
next |
|
end |
|
print "" |
|
print org_name |
|
print ">" |
|
|
|
# fields.each do |field| |
|
# print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.send(field).nil? }.count}>" |
|
# end |
|
print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.referral.nil? && l.renewal == 0 }.count}>" |
|
print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.tenancylength.nil? && [4, 6].include?(l.tenancy) }.count}>" |
|
print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.illness == 1 && illness_fields.all? { |illness_field| l.send(illness_field).zero?} }.count}>" |
|
|
|
# fields.each do |field| |
|
# print "#{org.sales_logs.where(status: "in_progress").select{ |l| l.send(field).nil? }.count}>" |
|
# end |
|
|
|
print "\n" |
|
end |
|
end |
|
|
|
print_org_data(org_names, fields, illness_fields)
|
|
|