diff --git a/importarExcel/importarexcel.js b/importarExcel/importarexcel.js index b07924f..515e177 100644 --- a/importarExcel/importarexcel.js +++ b/importarExcel/importarexcel.js @@ -1,107 +1,238 @@ -// Read Excel file and copy the relevant columns to the main table (with proper column types) +// Read Excel file and copy the relevant columns to the main table (with proper column types and names) +// +// Proper Naming const codetoNameEquivalences = { - "AAA": "Hospital Son Espases", - "70000": "Hospital General Universitario de Elche", - "70001": "Hospital Universitario de San Juan de Alicante", - "70002": "Hospital Universitario de Valme", - "70003": "Institut Catala de Salut", - "70004": "Servicio Andaluz de Salud", - "70005": "Servei Balear de Salut", - "70006": "Sección Suministro de Medicamentos Extranjeros de Madrid", - "70007": "Area de Gestión Almería Norte (Hospital Inmaculada)", - "70008": "Consejería de Salud de La Rioja", - "70009": "Servicio Murciano de Salud", - "70010": "Servicios Periféricos de Sanidad y Asuntos Sociales Albacete", - "70011": "Jefatura Territorial de Sanidad de Pontevedra", - "70012": "Departamento de Sanidad de Guipuzcoa", - "70013": "Hospital Clínico San Carlos", - "70014": "Agencia Sanitaria Costa del Sol", - "70015": "Consorcio Hospital General Universitario de Valencia", - "70016": "Hospital Luis Alcañiz de Xátiva", - "70017": "Hospital Materno Infantil Vall d'Hebron", - "70018": "Hospital Sant Joan de Reus", - "70019": "Institut d'Assistencia Sanitaria", - "70020": "Corporación Sanitaria Parc Tauli", - "70021": "Hospital Can Misses", - "70022": "Hospital Universitario Insular de Gran Canaria", - "70023": "Delegación Territorial de Salud de Bizkaia", - "70024": "Fundación Sant Hospital - Seo Urgel", - "70025": "Distrito Sanitario Jerez-Costa Norte", - "70026": "Consorcio Sanitario del Maresme", - "70027": "Consorcio Sanitario del Garraf", - "70028": "Hospital Son Llatzer", - "70029": "Consorcio Mar Parc de Salut (Hospital del Mar)", - "70030": "Hospital de la Ribera", - "70031": "Hospital Severo Ochoa de Leganés", - "70032": "Area de Gestión Sanitaria Sur de Granada", - "70033": "Hospital Universitario de Bellvitge", - "70034": "Hospital General Vall d'Hebron", - "70035": "Distrito Sanitario de Granada - Metropolitano - Complejo Almanjayar", - "70036": "Fundación Hospital Asilo de Granollers", - "70037": "Hospital General de Requena", - "70038": "Fundación Asistencial Mutua Terrasa", - "70039": "Althaia Xarxa Assistencial Universitaria Manresa", - "70040": "Hospital Universitario San Cecilio de Granada", - "70041": "Hospital Universitario La Fé", - "70042": "Consorcio Sanitario de Terrasa", - "70043": "Delegación Provincial de Sanidad de Orense", - "70044": "Hospital Clínico Universitario Virgen de la Victoria", - "70045": "Plataforma Logística Sanitaria Almería", - "70046": "Hospital General Universitario de Alicante", - "70047": "Fundación de Gestión Sanitaria de L'Hospitalet", - "70048": "Hospital Universitario Virgen de la Macarena", - "70049": "Hospital Marina Baixa", - "70050": "Gerencia de Salud de Área de Ávila", - "70055": "Consorcio Hospitalario de Vic", - "70060": "Servicio Canario de Salud", - "70061": "Distrito Sanitario Costa del Sol - Hospital Costa del Sol", - "70062": "Hospital de Manises de Valencia", - "70063": "Hospital Clínico de Barcelona", - "70064": "Hospital Comarcal de Sant Bernabé", - "70065": "Fundacio Salut Emporda", - "70070": "Hospital Materno Infantil de Málaga", - "70071": "Hospital San Francisco de Borja", - "70072": "Hospital San Juan de Dios", - "70073": "Hospital Universitario Dr. Peset", - "70074": "Hospital Vega Baja de Orihuela", - "70075": "Hospital de Denia - Marina Salud", - "70076": "Hospital Regional Carlos Haya", - "70077": "Hospital de Manacor", - "70080": "Delegación Provincial de Salud de Albacete - Hospital General", - "70081": "Hospital Universitario Arnau de Vilanova", - "70082": "Osakidetza", - "70083": "Hospital Mateu Órfila", - "70085": "Hospital General Básico de la Axarquía", - "70090": "Servicio Territorial de Sanidad y Bienestar Social de Burgos", - "70091": "Servicio Territorial de Sanidad y Bienestar Social de Valladolid", - "70095": "Hospital General de La Línea", - "70100": "Hospital Universitario Puerta de Hierro", - "70101": "Hospital General Universitario de Elda", - "70102": "Consorci Sanitari Integral de Hospitalet", - "70103": "Hospital Universitario Dr. Negrín", - "70105": "Hospital de Navarra", - "70106": "Hospital Juan XXIII", - "70107": "Hospital Arnau de Vilanova en Lliria", - "70110": "Hospital Universitario Central de Asturias", - "70115": "Gerencia de Salud de Área de Valladolid", - "70116": "Consejería de Sanidad Universal y Salud Pública de C. Valenciana", - "70120": "Dirección Provincial de Sanidad de Ciudad Real", - "70125": "Hospital Txagorritxu de Vitoria", - "70130": "Hospital Comarcal de Vinaroz", - "70135": "Distrito Sanitario Metropolitano de Granada", // Acaso no es el mismo que 70035? - "70140": "Hospital General Obispo Polanco", + "AAA": { name: "Hospital Son Espases", province: "Baleares", ccaa: "Islas Baleares", city: "Palma", }, + "BBB": { name: "Hospital Sant Joan Reus", province: "Barcelona", ccaa: "Cataluña", city: "Reus", }, + "CCC": { name: "Hospital Universitario Germans Trías y Pujol", province: "Barcelona", ccaa: "Cataluña", city: "Badalona", }, + "DDD": { name: "Hospital San Camilo", province: "Barcelona", ccaa: "Cataluña", city: "Sant Pere de Ribes", }, + "EEE": { name: "Hospital de Mataró", province: "Barcelona", ccaa: "Cataluña", city: "Mataró", }, + "FFF": { name: "Departamento de Sanidad de Vizcaya", province: "Vizcaya", ccaa: "País Vasco", city: "Bilbao", }, + "GGG": { name: "Hospital Santa Cruz y San Pablo", province: "Barcelona", ccaa: "Cataluña", city: "Barcelona", }, + "III": { name: "Consejería de Sanidad Madrid - Suministro de Medicamentos Extranjeros", province: "Madrid", ccaa: "Madrid", city: "Madrid", }, + "JJJ": { name: "Hospital Santa Caterina", province: "Gerona", ccaa: "Cataluña", city: "Salt", }, + "KKK": { name: "Hospital Universitario Vírgen del Rocío", province: "Sevilla", ccaa: "Andalucía", city: "Sevilla", }, + "70000": { name: "Hospital General Universitario de Elche", province: "Alicante", ccaa: "Comunitat Valenciana", city: "Elche", }, + "70001": { name: "Hospital Universitario de San Juan de Alicante", province: "Alicante", ccaa: "Comunitat Valenciana", city: "Alicante", }, + "70002": { name: "Hospital Universitario de Valme", province: "Sevilla", ccaa: "Andalucía", city: "Sevilla", }, + "70003": { name: "Institut Catala de Salut", province: "Barcelona", ccaa: "Cataluña", city: "Barcelona", }, + "70004": { name: "Servicio Andaluz de Salud", province: "Sevilla", ccaa: "Andalucía", city: "Sevilla", }, + "70005": { name: "Servei Balear de Salut", province: "Baleares", ccaa: "Islas Baleares", city: "Palma", }, + "70006": { name: "Sección Suministro de Medicamentos Extranjeros de Madrid", province: "Madrid", ccaa: "Madrid", city: "Madrid", }, + "70007": { name: "Area de Gestión Almería Norte (Hospital Inmaculada)", province: "Almería", ccaa: "Andalucía", city: "Almería", }, + "70008": { name: "Consejería de Salud de La Rioja", province: "La Rioja", ccaa: "La Rioja", city: "Logroño", }, + "70009": { name: "Servicio Murciano de Salud", province: "Murcia", ccaa: "Murcia", city: "Murcia", }, + "70010": { name: "Servicios Periféricos de Sanidad y Asuntos Sociales Albacete", province: "", ccaa: "", city: "", }, + "70011": { name: "Jefatura Territorial de Sanidad de Pontevedra", province: "", ccaa: "", city: "", }, + "70012": { name: "Departamento de Sanidad de Guipuzcoa", province: "", ccaa: "", city: "", }, + "70013": { name: "Hospital Clínico San Carlos", province: "", ccaa: "", city: "", }, + "70014": { name: "Agencia Sanitaria Costa del Sol", province: "", ccaa: "", city: "", }, + "70015": { name: "Consorcio Hospital General Universitario de Valencia", province: "", ccaa: "", city: "", }, + "70016": { name: "Hospital Luis Alcañiz de Xátiva", province: "", ccaa: "", city: "", }, + "70017": { name: "Hospital Materno Infantil Vall d'Hebron", province: "", ccaa: "", city: "", }, + "70018": { name: "Hospital Sant Joan de Reus", province: "", ccaa: "", city: "", }, + "70019": { name: "Institut d'Assistencia Sanitaria", province: "", ccaa: "", city: "", }, + "70020": { name: "Corporación Sanitaria Parc Tauli", province: "", ccaa: "", city: "", }, + "70021": { name: "Hospital Can Misses", province: "", ccaa: "", city: "", }, + "70022": { name: "Hospital Universitario Insular de Gran Canaria", province: "", ccaa: "", city: "", }, + "70023": { name: "Delegación Territorial de Salud de Bizkaia", province: "", ccaa: "", city: "", }, + "70024": { name: "Fundación Sant Hospital - Seo Urgel", province: "", ccaa: "", city: "", }, + "70025": { name: "Distrito Sanitario Jerez-Costa Norte", province: "", ccaa: "", city: "", }, + "70026": { name: "Consorcio Sanitario del Maresme", province: "", ccaa: "", city: "", }, + "70027": { name: "Consorcio Sanitario del Garraf", province: "", ccaa: "", city: "", }, + "70028": { name: "Hospital Son Llatzer", province: "", ccaa: "", city: "", }, + "70029": { name: "Consorcio Mar Parc de Salut (Hospital del Mar)", province: "", ccaa: "", city: "", }, + "70030": { name: "Hospital de la Ribera", province: "", ccaa: "", city: "", }, + "70031": { name: "Hospital Severo Ochoa de Leganés", province: "", ccaa: "", city: "", }, + "70032": { name: "Area de Gestión Sanitaria Sur de Granada", province: "", ccaa: "", city: "", }, + "70033": { name: "Hospital Universitario de Bellvitge", province: "", ccaa: "", city: "", }, + "70034": { name: "Hospital General Vall d'Hebron", province: "", ccaa: "", city: "", }, + "70035": { name: "Distrito Sanitario de Granada - Metropolitano - Complejo Almanjayar", province: "", ccaa: "", city: "", }, + "70036": { name: "Fundación Hospital Asilo de Granollers", province: "", ccaa: "", city: "", }, + "70037": { name: "Hospital General de Requena", province: "", ccaa: "", city: "", }, + "70038": { name: "Fundación Asistencial Mutua Terrasa", province: "", ccaa: "", city: "", }, + "70039": { name: "Althaia Xarxa Assistencial Universitaria Manresa", province: "", ccaa: "", city: "", }, + "70040": { name: "Hospital Universitario San Cecilio de Granada", province: "", ccaa: "", city: "", }, + "70041": { name: "Hospital Universitario La Fé", province: "", ccaa: "", city: "", }, + "70042": { name: "Consorcio Sanitario de Terrasa", province: "", ccaa: "", city: "", }, + "70043": { name: "Delegación Provincial de Sanidad de Orense", province: "", ccaa: "", city: "", }, + "70044": { name: "Hospital Clínico Universitario Virgen de la Victoria", province: "", ccaa: "", city: "", }, + "70045": { name: "Plataforma Logística Sanitaria Almería", province: "", ccaa: "", city: "", }, + "70046": { name: "Hospital General Universitario de Alicante", province: "", ccaa: "", city: "", }, + "70047": { name: "Fundación de Gestión Sanitaria de L'Hospitalet", province: "", ccaa: "", city: "", }, + "70048": { name: "Hospital Universitario Virgen de la Macarena", province: "", ccaa: "", city: "", }, + "70049": { name: "Hospital Marina Baixa", province: "", ccaa: "", city: "", }, + "70050": { name: "Gerencia de Salud de Área de Ávila", province: "", ccaa: "", city: "", }, + "70055": { name: "Consorcio Hospitalario de Vic", province: "", ccaa: "", city: "", }, + "70060": { name: "Servicio Canario de Salud", province: "", ccaa: "", city: "", }, + "70061": { name: "Distrito Sanitario Costa del Sol - Hospital Costa del Sol", province: "", ccaa: "", city: "", }, + "70062": { name: "Hospital de Manises de Valencia", province: "", ccaa: "", city: "", }, + "70063": { name: "Hospital Clínico de Barcelona", province: "", ccaa: "", city: "", }, + "70064": { name: "Hospital Comarcal de Sant Bernabé", province: "", ccaa: "", city: "", }, + "70065": { name: "Fundacio Salut Emporda", province: "", ccaa: "", city: "", }, + "70070": { name: "Hospital Materno Infantil de Málaga", province: "", ccaa: "", city: "", }, + "70071": { name: "Hospital San Francisco de Borja", province: "", ccaa: "", city: "", }, + "70072": { name: "Hospital San Juan de Dios", province: "", ccaa: "", city: "", }, + "70073": { name: "Hospital Universitario Dr. Peset", province: "", ccaa: "", city: "", }, + "70074": { name: "Hospital Vega Baja de Orihuela", province: "", ccaa: "", city: "", }, + "70075": { name: "Hospital de Denia - Marina Salud", province: "", ccaa: "", city: "", }, + "70076": { name: "Hospital Regional Carlos Haya", province: "", ccaa: "", city: "", }, + "70077": { name: "Hospital de Manacor", province: "", ccaa: "", city: "", }, + "70080": { name: "Delegación Provincial de Salud de Albacete - Hospital General", province: "", ccaa: "", city: "", }, + "70081": { name: "Hospital Universitario Arnau de Vilanova", province: "", ccaa: "", city: "", }, + "70082": { name: "Osakidetza", province: "", ccaa: "", city: "", }, + "70083": { name: "Hospital Mateu Órfila", province: "", ccaa: "", city: "", }, + "70085": { name: "Hospital General Básico de la Axarquía", province: "", ccaa: "", city: "", }, + "70090": { name: "Servicio Territorial de Sanidad y Bienestar Social de Burgos", province: "", ccaa: "", city: "", }, + "70091": { name: "Servicio Territorial de Sanidad y Bienestar Social de Valladolid", province: "", ccaa: "", city: "", }, + "70095": { name: "Hospital General de La Línea", province: "", ccaa: "", city: "", }, + "70100": { name: "Hospital Universitario Puerta de Hierro", province: "", ccaa: "", city: "", }, + "70101": { name: "Hospital General Universitario de Elda", province: "", ccaa: "", city: "", }, + "70102": { name: "Consorci Sanitari Integral de Hospitalet", province: "", ccaa: "", city: "", }, + "70103": { name: "Hospital Universitario Dr. Negrín", province: "", ccaa: "", city: "", }, + "70105": { name: "Hospital de Navarra", province: "", ccaa: "", city: "", }, + "70106": { name: "Hospital Juan XXIII", province: "", ccaa: "", city: "", }, + "70107": { name: "Hospital Arnau de Vilanova en Lliria", province: "", ccaa: "", city: "", }, + "70110": { name: "Hospital Universitario Central de Asturias", province: "", ccaa: "", city: "", }, + "70115": { name: "Gerencia de Salud de Área de Valladolid", province: "", ccaa: "", city: "", }, + "70116": { name: "Consejería de Sanidad Universal y Salud Pública de C. Valenciana", province: "", ccaa: "", city: "", }, + "70120": { name: "Dirección Provincial de Sanidad de Ciudad Real", province: "", ccaa: "", city: "", }, + "70125": { name: "Hospital Txagorritxu de Vitoria", province: "", ccaa: "", city: "", }, + "70130": { name: "Hospital Comarcal de Vinaroz", province: "", ccaa: "", city: "", }, + "70135": { name: "Distrito Sanitario Metropolitano de Granada", province: "", ccaa: "", city: "", }, + "70140": { name: "Hospital General Obispo Polanco", province: "", ccaa: "", city: "", }, + "70141": { name: "Hospital Universitario de Torrevieja (antiguo Torrevieja Salud UTE)", province: "", ccaa: "", city: "", }, + "70142": { name: "Hospital General Universitario Gregorio Marañón", province: "", ccaa: "", city: "", }, + "70145": { name: "Hospital Universitario La Paz", province: "", ccaa: "", city: "", }, + "70146": { name: "Dirección Territorial Sanidad de Álava", province: "", ccaa: "", city: "", }, + "70147": { name: "SERGAS", province: "", ccaa: "", city: "", }, + "70148": { name: "Hospital General La Mancha-Centro", province: "", ccaa: "", city: "", }, + "70150": { name: "Complejo Universitario Asistencial de Salamanca", province: "", ccaa: "", city: "", }, + "70151": { name: "Hospital Dos de Mayo", province: "", ccaa: "", city: "", }, + "70155": { name: "Hospital de Basurto", province: "", ccaa: "", city: "", }, + "70156": { name: "Delegación Provincial de Salud de Toledo", province: "", ccaa: "", city: "", }, + "70160": { name: "Distrito Sanitario Bahía de Cádiz - Lajanda", province: "", ccaa: "", city: "", }, + "70165": { name: "Gerencia del Área de Salud de Plasencia", province: "", ccaa: "", city: "", }, + "70166": { name: "Hospital Infanta Elena de Huelva", province: "", ccaa: "", city: "", }, + "70170": { name: "Servicio Territorial de Sanidad y Bienestar Social de Soria", province: "", ccaa: "", city: "", }, + "70171": { name: "Gerencia de Asistencia Sanitaria de Soria", province: "", ccaa: "", city: "", }, + "70172": { name: "Gerencia de Salud de Área de Burgos", province: "", ccaa: "", city: "", }, + "70175": { name: "Hospital Santa Ana de Motril", province: "", ccaa: "", city: "", }, + "70180": { name: "Atención Primaria de Campo de Gibraltar", province: "", ccaa: "", city: "", }, + "70181": { name: "Hospital General de Fuerteventura", province: "", ccaa: "", city: "", }, + "70182": { name: "Hospital Clínico Universitario de Santiago de Compostela", province: "", ccaa: "", city: "", }, + "70183": { name: "Elche Crevillente Salud", province: "", ccaa: "", city: "", }, + "70185": { name: "Hospital Universitario 12 de Octubre", province: "", ccaa: "", city: "", }, + "70186": { name: "Hospital Clínico Universitario de Valencia", province: "", ccaa: "", city: "", }, + "70187": { name: "Hospital San Pablo y Santa Tecla", province: "", ccaa: "", city: "", }, + "70188": { name: "Fundación Sanitaria de Mollet", province: "", ccaa: "", city: "", }, + "70189": { name: "Plataforma Provincial de Logística Sanitaria de Jaén", province: "", ccaa: "", city: "", }, + "70190": { name: "Hospital General Universitario Reina Sofía de Murcia", province: "", ccaa: "", city: "", }, + "70195": { name: "Hospital Dr. Josep Trueta", province: "", ccaa: "", city: "", }, + "70200": { name: "Hospital de Sant Celoni", province: "", ccaa: "", city: "", }, + "70201": { name: "Gerencia de Asistencia Sanitaria de Zamora", province: "", ccaa: "", city: "", }, + "70202": { name: "Servicio Territorial de Sanidad y Bienestar Social de Zamora", province: "", ccaa: "", city: "", }, + "70203": { name: "Hospital Casa Maternidad", province: "", ccaa: "", city: "", }, + "70204": { name: "Hospital de Baza", province: "", ccaa: "", city: "", }, + "70205": { name: "Hospital Clínico Universitario Lozano Bles", province: "", ccaa: "", city: "", }, + "70206": { name: "Clínica ORL S.A.", province: "", ccaa: "", city: "", }, + "70210": { name: "Corporación de Salut del Maresme", province: "", ccaa: "", city: "", }, + "70211": { name: "Centro Penitenciario Madrid V - Soto del Real", province: "", ccaa: "", city: "", }, + "70212": { name: "Hospital Central de la Defensa de Madrid", province: "", ccaa: "", city: "", }, + "70213": { name: "Distrito Córdoba", province: "", ccaa: "", city: "", }, + "70215": { name: "Hospital General de Ciudad Real", province: "", ccaa: "", city: "", }, + "70220": { name: "Dirección General de Farmacia de Las Palmas", province: "", ccaa: "", city: "", }, + "70225": { name: "Hospital Nuestra Señora de Sonsoles", province: "", ccaa: "", city: "", }, + "70230": { name: "Hospital General de Tomelloso", province: "", ccaa: "", city: "", }, + "70235": { name: "Hospital Gutiérrez Ortega", province: "", ccaa: "", city: "", }, + "70236": { name: "Atención Primaria Dpto. 4", province: "", ccaa: "", city: "", }, + "70237": { name: "Distrito Sanitario Málaga Guadalhorce", province: "", ccaa: "", city: "", }, + "70240": { name: "Hospital Universitario Marqués de Valdecilla", province: "", ccaa: "", city: "", }, + "70241": { name: "Servicio Integral de Sanidad S.L. (Red Asistencial Juaneda)", province: "", ccaa: "", city: "", }, + "70242": { name: "Hospital de Tortosa - Virgen de la Cinta", province: "", ccaa: "", city: "", }, + "70245": { name: "Hospital Municipal de Badalona", province: "", ccaa: "", city: "", }, + "70250": { name: "Atención Primaria V", province: "", ccaa: "", city: "", }, + "70255": { name: "Servicio Territorial de Sanidad y Bienestar Social de Palencia", province: "", ccaa: "", city: "", }, + "70256": { name: "Gerencia de Salud de Área de Palencia", province: "", ccaa: "", city: "", }, + "70260": { name: "Hospital Doctor José Molina Orosa", province: "", ccaa: "", city: "", }, + "70261": { name: "Hospital Virgen de la Luz", province: "", ccaa: "", city: "", }, + "70262": { name: "Servico Aragónes de Salud", province: "", ccaa: "", city: "", }, + "70265": { name: "Servicio Navarro de Salud", province: "", ccaa: "", city: "", }, + "70266": { name: "Atención Primaria IV", province: "", ccaa: "", city: "", }, + "70267": { name: "Departamento de Economía y Hacienda de la Generalitat de Cataluña", province: "", ccaa: "", city: "", }, + "70268": { name: "Delegación Provincial de Sanidad de Cuenca", province: "", ccaa: "", city: "", }, + "70270": { name: "Centro Penitenciario Madrid IV - Navalcarnero", province: "", ccaa: "", city: "", }, + "70271": { name: "Hospital Universitario Fundación Alcorcón", province: "", ccaa: "", city: "", }, + "70275": { name: "Centro Penitenciario Castellón II", province: "", ccaa: "", city: "", }, + "70276": { name: "IDCQ Hospitales y Sanidad S.L.U.", province: "", ccaa: "", city: "", }, + "70277": { name: "Xerencia de Gestión Integral A Coruña", province: "", ccaa: "", city: "", }, + "70280": { name: "Hospital Reina Sofía", province: "", ccaa: "", city: "", }, + "70285": { name: "Servicio Murciano de Salud - Área Virgen del Castillo", province: "", ccaa: "", city: "", }, + "70290": { name: "Distrito Jaén Norte", province: "", ccaa: "", city: "", }, + "70291": { name: "Hospital Virgen de Altagracia", province: "", ccaa: "", city: "", }, + "70295": { name: "Hospital Médico Quirúrgio de Jaén", province: "", ccaa: "", city: "", }, + "70296": { name: "Hospital San Pedro de Logroño", province: "", ccaa: "", city: "", }, + "70297": { name: "Hospital Santiago Apostol de Vitoria", province: "", ccaa: "", city: "", }, + "70298": { name: "Hospital Vithas Xanit Internacional de Benalmádena", province: "", ccaa: "", city: "", }, + "70300": { name: "Hospital Rafael Méndez-Lorca", province: "", ccaa: "", city: "", }, + "70305": { name: "Agencia Sanitaria Hospital de Poniente", province: "", ccaa: "", city: "", }, + "70310": { name: "Gerencia Área de Salud de Cáceres", province: "", ccaa: "", city: "", }, + "70311": { name: "Hospital de Palamós", province: "", ccaa: "", city: "", }, + "70315": { name: "Hospital Fundación Jiménez Díaz", province: "", ccaa: "", city: "", }, + "70320": { name: "Distrito Sanitario Sierra de Cádiz", province: "", ccaa: "", city: "", }, + "70321": { name: "Hospital Alto Deba", province: "", ccaa: "", city: "", }, + "70322": { name: "Dirección Provincial de la Consejería de Asuntos Sociales de Guadalajara", province: "", ccaa: "", city: "", }, + "70323": { name: "Fundación Hospital Dolot I", province: "", ccaa: "", city: "", }, + "70324": { name: "Hospital Nuestra Señora del Prado de Talavera", province: "", ccaa: "", city: "", }, + "70330": { name: "Clínica Benidorm", province: "", ccaa: "", city: "", }, + "70337": { name: "SESCAM", province: "", ccaa: "", city: "", }, + "70366": { name: "Consejería de Sanidad - Servicios de Farmacia", province: "", ccaa: "", city: "", }, + "70375": { name: "Hospital García Orcoyen", province: "", ccaa: "", city: "", }, + "70385": { name: "Hospital San Jorge de Huesca", province: "", ccaa: "", city: "", }, + "70395": { name: "Área de Gestión Sanitaria Norte Huelva - Hospital Rio Tinto", province: "", ccaa: "", city: "", }, + "70400": { name: "Hospital Infanta Cristina", province: "", ccaa: "", city: "", }, + "70415": { name: "Servicio Murciano de Salud", province: "", ccaa: "", city: "", }, + "70436": { name: "Servicio Territorial de Sanidad y Bienestar Social de Ávila", province: "", ccaa: "", city: "", }, + "70437": { name: "EST ORG XES INT Vigo", province: "", ccaa: "", city: "", }, + "70466": { name: "Instituto Catalán de Oncología", province: "", ccaa: "", city: "", }, + "70480": { name: "Fundación Sanitaria Igualada", province: "", ccaa: "", city: "", }, + "70491": { name: "Hospital Infantil Universitario Niño Jesús", province: "", ccaa: "", city: "", }, + "70492": { name: "Servicio Territorial de Sanidad y Bienestar Social de Salamanca", province: "", ccaa: "", city: "", }, + "70494": { name: "Hospital Sant Joan Despí Moisés Broggi", province: "", ccaa: "", city: "", }, + "70495": { name: "Hospital Comarcal de Melilla", province: "", ccaa: "", city: "", }, + "70501": { name: "Hospital de la Plana de Vila-Real", province: "", ccaa: "", city: "", }, + "70525": { name: "Hospital Universitario de Fuenlabrada", province: "", ccaa: "", city: "", }, + "70535": { name: "Consorci Sanitari de l'Alt Penedés", province: "", ccaa: "", city: "", }, + "70540": { name: "Parc Sanitari Sant Joan de Deu", province: "", ccaa: "", city: "", }, + "70545": { name: "Hospital de Torrejón", province: "", ccaa: "", city: "", }, + "70550": { name: "Consorci Sanitari de l'Alt Penedés", province: "", ccaa: "", city: "", }, + "70555": { name: "Servicio Territorial de Sanidad y Bienestar Social de León", province: "", ccaa: "", city: "", }, + "70560": { name: "Distrito Sanitario de Sevilla - Quiñones", province: "", ccaa: "", city: "", }, + "70561": { name: "IDCSalud Móstoles", province: "", ccaa: "", city: "", }, + "70565": { name: "EDP Salut Sant Joan de Reus - Baix Camp", province: "", ccaa: "", city: "", }, } // CONSTANTS -const ORIGIN_TABLE_NAME = "BASE DE DATOS"; +const ORIGIN_TABLE_NAME = "raw_data"; const ORIGIN_VIEW_NAME = "Default View"; -const TARGET_TABLE_NAME = "Brutos" +const TARGET_TABLE_NAME = "Abarax España" const TARGET_VIEW_NAME = "Default View"; + // Helper functions -const clientCodeToName = (code) => { +const cleanTable = (name) => { // Removes all rows from a table + const table = base.getTableByName(name); + if (table) { + const rows = base.getRows(table, "Default View"); + rows.forEach(row => { + base.deleteRowById(table, row._id) + }) + + } +} +const clientCodeToName = (code) => { // Normalizes names according to client Code const clientCode = code.toString(); let clientName = ""; if (codetoNameEquivalences[clientCode]) { @@ -110,7 +241,7 @@ const clientCodeToName = (code) => { return clientName; } -const removeDoubleSpace = (str) => { +const removeDoubleSpace = (str) => { // Removes double spaces in string if (typeof str !== "string") { return str; } @@ -125,7 +256,7 @@ const removeLeadingAndTrailingSpaces = (str) => { return str.trim(); } -const matcodeToAbarax = (str) => { +const MaterialCodeToDose = (str) => { if (str === 211354) { return "50mg"; } @@ -165,7 +296,7 @@ originRows.forEach(row => { }); // Material to Abarax - element["Material"] = matcodeToAbarax(element["Material"]); + element["Material"] = MaterialCodeToDose(element["Material"]); // Add element to dataMatrix dataMatrix.push(element);