The healthcare sector consists of businesses that provide medical services, manufacture medical equipment or drugs, provide medical insurance, or otherwise facilitate the provision of healthcare to patients.
These software components cover functions across Pharma and Life Sciences, Healthcare Providers areas.
Popular New Releases in Healthcare
MONAI
0.8.1
deepvariant
DeepVariant 1.3.0
Viewers
@ohif/core@2.16.18
corona-cli
🚀 RELEASE: 5.3.3
wger
Popular Libraries in Healthcare
by owid python
5212
Data on COVID-19 (coronavirus) cases, deaths, hospitalizations, tests • All countries • Updated daily by Our World in Data
by Project-MONAI python
2901 Apache-2.0
AI Toolkit for Healthcare Imaging
by biopython python
2836 NOASSERTION
Official git repository for Biopython (originally converted from CVS)
by 1000hz javascript
2407 MIT
A user-friendly HTML5 form validation jQuery plugin for Bootstrap 3
by google python
2390 BSD-3-Clause
DeepVariant is an analysis pipeline that uses a deep neural network to call genetic variants from next-generation DNA sequencing data.
by disease-sh javascript
2368 GPL-3.0
API for Current cases and more stuff about COVID-19 and Influenza
by geohot python
1920
Reverse engineering SARS-CoV-2
by OHIF javascript
1875 MIT
OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
by openemr php
1855 NOASSERTION
The most popular open source electronic health records and medical practice management solution.
Trending New libraries in Healthcare
by owid python
5212
Data on COVID-19 (coronavirus) cases, deaths, hospitalizations, tests • All countries • Updated daily by Our World in Data
by disease-sh javascript
2368 GPL-3.0
API for Current cases and more stuff about COVID-19 and Influenza
by geohot python
1920
Reverse engineering SARS-CoV-2
by ahmadawais javascript
1746 MIT
🦠Track the Coronavirus disease (COVID-19) in the command line. Worldwide for all countries, for one country, and the US States. Fast response time (< 100ms). To chat: https://twitter.com/MrAhmadAwais/
by ExpDev07 python
1530 GPL-3.0
🦠A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
by soroushchehresa javascript
1403 MIT
🦠Huge collection of useful projects and resources for COVID-19 (2019 novel Coronavirus)
by neherlab javascript
1380 MIT
Models of COVID-19 outbreak trajectories and hospital demand
by nextstrain python
1270 MIT
Nextstrain build for novel coronavirus SARS-CoV-2
by pomber javascript
1186
JSON time-series of coronavirus cases (confirmed, deaths and recovered) per country - updated daily
Top Authors in Healthcare
1
12 Libraries
114
2
4 Libraries
70
3
4 Libraries
167
4
3 Libraries
58
5
3 Libraries
74
6
3 Libraries
47
7
3 Libraries
69
8
3 Libraries
64
9
3 Libraries
32
10
3 Libraries
52
1
12 Libraries
114
2
4 Libraries
70
3
4 Libraries
167
4
3 Libraries
58
5
3 Libraries
74
6
3 Libraries
47
7
3 Libraries
69
8
3 Libraries
64
9
3 Libraries
32
10
3 Libraries
52
Trending Kits in Healthcare
The healthcare system is genuinely stretched with a growing population, expanding life expectancy, and now further with the pandemic. The health-tech industry has delivered multiple innovations over the years. With maturing AI and investments in the healthcare space, Ambient Clinical Intelligence has emerged as a critical focus area in heath-tech.
Ambient Clinical Intelligence encompasses leveraging AI across the provider lifecycle and seamlessly integrating with Electronic Health Records systems. The most impactful areas are automated clinical documentation, improving patient data for downstream provider and payer processes, reducing provider workload, and improving the time they can spend with patient care activities. Additional use cases across telehealth, radiology, medical events prediction, payer adjudication are possible with Ambient Clinical Intelligence.
To help jumpstart your Ambient Clinical Intelligence applications, we have assembled a diverse set of software components.
If you are further interested, search to discover more exciting components to jumpstart your application development on kandi.
Speech to Text and NLP
stanza by stanfordnlp, Medico by pranayjoshi, PrescAI by 090max are components that help you experiment on speech to text and NLP with specialization on healthcare.
Cloud Speech to Text
If you would like to compare the speech to text capabilities of the hyperscale cloud providers, try Cloud Speech-to-Text API by Google, Train-Custom-Speech-Model by IBM, and amazon-comprehend-medical-fhir-integrationby aws-samples.
Automated Clinical Actions
If you further want to experiment on medical event prediction and automated clinical actions, try ehr-rwe by som-shahlab, SequentialPhenotypePredictor by wael34218, MetaPred by sheryl-ai, CogStack-SemEHR by CogStack, clicr by clips.
Patient Data and EHR
To support these applications and experiments, you would need an EHR/ EMR to connect to, such as openemr by openemr, and tons of patient data that you can synthesize from components such as syntheaby synthetichealth.
The Healthcare Price Transparency Rule took effect this year. The rule requires hospitals in the USA to post actual prices from the rates they offer cash-paying customers to costs negotiated with insurers. The Healthcare Price Transparency Rule could help reduce prices and keep consumers informed of their choices before seeking care. Hospitals must publicly post prices for every service, drug, and supply they provide on their website. The prices must be posted in a machine-readable format, and for 300 common and “shoppable” services, they must also be provided in consumer-friendly formats.
Over the next couple of years, such healthcare information exchange initiatives are expected to accelerate. The initiatives provide a substantial opportunity for digital healthcare and health-tech solutions. Healthcare digital transformations expected in the short term are Payer-to-Payer Data exchange, No Surprises Act, Prior Authorization rule, Transparency in Coverage. Critical to the success of these initiatives is the Fast Healthcare Interoperability Resources (FHIR) framework.
There are over 1800 libraries available to accelerate your health-tech development on FHIR. The kandi collections on Healthcare Price Transparency Rule Implementation Libraries showcases the top libraries across core FHIR HL7 integration, FHIR standards related to Centers for Medicare & Medicaid Services (CMS) requirements, and libraries specific to healthcare provider pricing and analysis.
Fundamentals of FHIR
fhir by HL7, hapi-fhir by hapifhir and fhir by google are popular libraries to help cover the fundamentals of FHIR implementation.
FHIR standards related to Centers for Medicare & Medicaid Services requirements
For capabilities related to FHIR standards related to Centers for Medicare & Medicaid Services requirements, refer to Smile CDR FHIR Data Platform by Smile_CDR_Inc, QDM-QICore-Conversion by MeasureAuthoringTool and connectathon-data by paciowg.
Libraries for Hospital Price Publishing and Comparison
medicompare by hathix, provider-data-tools by HHSIDEAlab, hospitals-scraper by dtangeeda, hospitals-ui by dtangeeda, and hospital-chargemaster by vsoch provide for scraping, publishing and comparing hospital charges.
Given the strain on the healthcare infrastructure and personnel and the virality of the pandemic, telemedicine (telehealth) solutions have become a mainstay.
While larger healthcare providers have adopted scalable telehealth solutions, small and independent practitioners have to contend with ad-hoc solutions. Global data shows an uptick in telemedicine consultations and a significant increase in wait times for non COVID19 patients. This shows a significant opportunity for open telemedicine solutions that can help bridge this gap. While the entire healthcare ecosystem is in the frontline of battling the pandemic, the technology and specifically the open source community can help alleviate access to healthcare through free and open telemedicine solutions.
There are over 420 public libraries available for telemedicine solutions. kandi collection on Telemedicine Solutions provides you with public libraries that provide base schemas, frameworks, and integration for end to end telehealth solutions to readymade telemedicine platforms, interesting solutions like symptom checkers, simple telehealth solutions using Office 365 as well as nuanced use cases like providing accessible telemedicine to vulnerable populations like refugees.
Telemedicine broadly covers aspects of using smartphones and tablets in providing video conferencing consultations, varying degrees of remote patient monitoring, communication, payer integration, pharmacy integration, nursing, and others. More advanced solutions cover teletrauma, emergency care, telesurgery, amongst others.
For other Telemedicine, Telehealth solutions, or specific implementations, search on kandi.
Telemedicine Core Frameworks
cht-core by medic, and ipf by oehf provide base frameworks and integrations to help build solutions ground up for multiple use cases.
Prebuilt Telemedicine solutions
Telemedicine by opensource-emr, iMediXcare by jmGithub2021, and FollowMyHealth by Allscripts Healthcare Solutions, Inc. provide prebuilt Telemedicine solutions that you can reuse.
Schemas and Data
ehealth.schema by edenlabllc and Telemedicine Utilization data by Change Healthcare provide for schemas and data to use in understanding and designing your Telemedicine solutions.
Unique Stand-alone Use Cases
symptomchecker by priaid-eHealth, CSE-Telehealth-Samples by Microsoft and Soteria by Daniel-Wu provide unique use cases such as intelligent triaging, simple Telehealth use case implementation using existing Office 365 capabilities, and providing for discreet Telemedicine access to refugees.
Around the globe, people seek the help of doctors when they are ill, but they are not available due to some reason. The Cancer Disease Prediction application is end-user support and online consultation treatment. The application allows user to share their health-related metrics for cancer prediction, which processes patient details to check for various conditions that could be associated. We can use intelligent data mining techniques to guess the most accurate state of a patient's details. Various steps involved in this kit are: 1. Data Preparation 2. Data Mining 3. Pattern Recognition 4. Knowledge Representation Based on the result, the system automatically shows the result-specific doctors for further treatment. The system allows users to view doctor's details. Listed below are the best libraries that can help data mining and build a prediction system for cancer.
Pattern Recognition
Data Mining
Data preparation
Knowledge Representation
COVID-19 vaccination booking automation has piqued interest and seen significant movement in the repositories in the last two weeks. Created by programmers for themselves and their loved ones, these provide for good community reusability. This is a sensitive topic and not intended nor implied as a substitute for professional medical advice and is provided for educational purposes only. We've shortlisted libraries across Python, Javascript, Ruby, and Cloud APIs and showcase functions to book appointments, review vaccine availability, and understand the working of vaccination campaigns. The sample provides connectivity to vaccination programs in different countries across North America, Europe, and Asia.
Is mindfulness on your new year resolution? If so, there are dozens of open source apps that help you with guided meditation, timers, relaxing sounds, visuals, and many more. The kandi kit on Meditation and Mindfulness Apps showcases multiple apps ranging from simple web apps, mobile apps and VR. It is also fascinating to note that many apps have low stars and are undiscovered. Compare that to Headspace Health and Calm with multi-billion dollar valuations! You might have a great business opportunity at hand while achieving nirvana. Given the increasing mental health crisis accelerated by the pandemic, meditation apps have become very useful. Consumers are treating mental health as a vital parameter and are proactively seeking help for betterment. Most apps provide mindfulness and meditation tools in different forms. They could be used for coaching, self-learning, therapy, psychiatry, and many other uses. Many commercial apps are seeking clinical studies on the positive effects of meditation on patient health outcomes.
The past year has been a whirlwind across all areas, including the workplace. Global events ranging from the COVID-19 pandemic, mass social movements, the economic downturn, and mass job losses in various sectors are increasing anxiety, stress, and physical ill-health across the workplace. Unpredictable and newly formed hybrid working conditions across the global workforce are driving employee burnout. The USA had over 11.5 million workers resigning from their jobs between April to June of 2021. The World Economic Forum is launching a new Chief Health/Medical Officers community and advising businesses to prioritize workforce well-being by appointing Chief Health Officers to their boardrooms, with the mandate to build a culture of health in the workplace. There are over a few thousand open source libraries that promote workplace well-being. kandi kit on Workplace Well-Being Solutions covers use cases across scheduling break times, inspiring workdays, developing positive habits, promoting mindfulness, sharing inspiration, and more.
You can build predictive analytic based applications with this ready to deploy template application. Fully modifiable source code modifies your needs.
Use this kandi 1-Click Solution kit to build your own AI-based Breast Cancer Detection Engine in minutes.
âś… Using this application you can do early stage detection for breast cancer and help in identifying it as malignant(cancerous) or benign(non-cancerous).
âś… You can build predictive analytic based applications with this ready to deploy template application.
âś… Fully modifiable source code is provided to enable you to modify for your requirements.
Development Environment
VSCode and Jupyter Notebook are used for development and debugging. Jupyter Notebook is a web based interactive environment often used for experiments, whereas VSCode is used to get a typical experience of IDE for developers.
Jupyter Notebook is used for our development.
Machine Learning
Simple and efficient tools for predictive data analysis.
Scikit-learn is a free software machine learning library which features various classification, regression and clustering algorithms including support-vector machines,etc. Similar libraries for ML support in Java, Scala and R programming language
Support
If you need help using this kit, you may reach us at the OpenWeaver Community.
Trending Discussions on Healthcare
how to change color of links in dropdown menu in navbar toggle
Calculating numbers of week for a specific time period
Year and Text Parsing with Regex
How to get list of all objects associated with a foreign key in Django
Looping through elements with Selenium and ChromeDriver
MongoDB - Querying inner object that is an array
Dockerize Flask: Error: While importing 'app', an ImportError was raised
search unique element pairs and transform sorted result to JSON
Clean trailing period if present as last non whitespace of dataframe column
Passing several fields if meets a criteria to a Hidden Form Field
QUESTION
how to change color of links in dropdown menu in navbar toggle
Asked 2022-Apr-10 at 04:31My navigation bar has a dropdown menu that looks like this. when I resize my browser to get the small device version it looks like this.
I want to change the color of links in the dropdown(services) to black but I don't know which class to select for CSS. I tried this but didn't work out.
1.dropdown-menu {
2 display: none;
3 position: absolute;
4 background-color: #00ff99;
5 min-width: 160px;
6 box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
7 z-index: 1;
8}
9.dropdown-menu > li > a {
10 float: none;
11 color: black;
12 padding: 12px 16px;
13 text-decoration: none;
14 display: block;
15 text-align: left;
16}
17.navbar-toggle .dropdown-menu > li > a{
18 color: black;
19}
20
21
this is my HTML
1.dropdown-menu {
2 display: none;
3 position: absolute;
4 background-color: #00ff99;
5 min-width: 160px;
6 box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
7 z-index: 1;
8}
9.dropdown-menu > li > a {
10 float: none;
11 color: black;
12 padding: 12px 16px;
13 text-decoration: none;
14 display: block;
15 text-align: left;
16}
17.navbar-toggle .dropdown-menu > li > a{
18 color: black;
19}
20
21<div class="navbar navbar-inverse navbar-fixed-top">
22<div class="container">
23<div class="navbar-header">
24 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
25 <span class="icon-bar"></span>
26 <span class="icon-bar"></span>
27 <span class="icon-bar"></span>
28 </button>
29 @Html.ActionLink("E-HealthCare", "About", "Home", new { area = "" }, new { @class = "navbar-brand shadow" })
30</div>
31<div class="navbar-collapse collapse">
32<ul class="nav navbar-nav">
33 <li>@Html.ActionLink("Home", "About", "Home")</li>
34 @*
35 <li>@Html.ActionLink("About", "About", "Home")</li>
36 <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
37 <li>@Html.DropDownList("Services","ALL")</li>
38 *@
39 <li>
40 <div class="dropdown">
41 <button class="Dropdown-btn btn-block text-left dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="false">
42 Services
43 <span class="caret"></span>
44 </button>
45 <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
46 <li><a href="#">Action</a></li>
47 <li><a href="#">Another action</a></li>
48 <li><a href="#">Something else here</a></li>
49 <li role="separator" class="divider"></li>
50 <li><a href="#">Separated link</a></li>
51 </ul>
52 </div>
53 </li>
54</ul>
55
ANSWER
Answered 2022-Apr-10 at 04:20I think you need to go futher more with this. Because the one you need to go to is .dropdown-menu > li > a > li > ul
which is in my opinion is too heavy. Try add this one to your code
1.dropdown-menu {
2 display: none;
3 position: absolute;
4 background-color: #00ff99;
5 min-width: 160px;
6 box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
7 z-index: 1;
8}
9.dropdown-menu > li > a {
10 float: none;
11 color: black;
12 padding: 12px 16px;
13 text-decoration: none;
14 display: block;
15 text-align: left;
16}
17.navbar-toggle .dropdown-menu > li > a{
18 color: black;
19}
20
21<div class="navbar navbar-inverse navbar-fixed-top">
22<div class="container">
23<div class="navbar-header">
24 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
25 <span class="icon-bar"></span>
26 <span class="icon-bar"></span>
27 <span class="icon-bar"></span>
28 </button>
29 @Html.ActionLink("E-HealthCare", "About", "Home", new { area = "" }, new { @class = "navbar-brand shadow" })
30</div>
31<div class="navbar-collapse collapse">
32<ul class="nav navbar-nav">
33 <li>@Html.ActionLink("Home", "About", "Home")</li>
34 @*
35 <li>@Html.ActionLink("About", "About", "Home")</li>
36 <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
37 <li>@Html.DropDownList("Services","ALL")</li>
38 *@
39 <li>
40 <div class="dropdown">
41 <button class="Dropdown-btn btn-block text-left dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="false">
42 Services
43 <span class="caret"></span>
44 </button>
45 <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
46 <li><a href="#">Action</a></li>
47 <li><a href="#">Another action</a></li>
48 <li><a href="#">Something else here</a></li>
49 <li role="separator" class="divider"></li>
50 <li><a href="#">Separated link</a></li>
51 </ul>
52 </div>
53 </li>
54</ul>
55#dropdown {
56 float: none;
57 color: black;
58 padding: 12px 16px;
59 text-decoration: none;
60 display: block;
61 text-align: left;
62}
63
QUESTION
Calculating numbers of week for a specific time period
Asked 2022-Mar-30 at 15:16Hi I have this data frame which contains the start and end dates of healthcare services. It looks like this:
1id <- c("A", "B", "B", "C", "D")
2start_date <- c("2014-08-18", "2014-08-04", "2016-10-10", "2016-04-01", "2015-12-31")
3end_date <- c("2018-09-01", "2019-09-22", "2016-10-18", "2016-05-01", "2016-04-08")
4
5df <- data.frame(id, start_date, end_date)
6
7 id start_date end_date
81 A 2014-08-18 2018-09-01
92 B 2014-08-04 2019-09-22
103 B 2016-10-10 2016-10-18
114 C 2016-04-01 2016-05-01
125 D 2015-12-31 2016-04-08
13
The IDs are not unique because people may had multiple services simultaneously. These services may spanned across many years. However, I would like to calculate numbers of weeks for each service within the financial year 2016, which starts at 2016-04-01 and ends at 2017-03-31. The data frame that I would like to have is:
1id <- c("A", "B", "B", "C", "D")
2start_date <- c("2014-08-18", "2014-08-04", "2016-10-10", "2016-04-01", "2015-12-31")
3end_date <- c("2018-09-01", "2019-09-22", "2016-10-18", "2016-05-01", "2016-04-08")
4
5df <- data.frame(id, start_date, end_date)
6
7 id start_date end_date
81 A 2014-08-18 2018-09-01
92 B 2014-08-04 2019-09-22
103 B 2016-10-10 2016-10-18
114 C 2016-04-01 2016-05-01
125 D 2015-12-31 2016-04-08
13 id start_date end_date wks_FY16
141 A 2014-08-18 2018-09-01 52
152 B 2014-08-04 2019-09-22 52
163 B 2016-10-10 2016-10-18 1
174 C 2016-04-01 2016-05-01 4
185 D 2015-12-31 2016-04-08 1
19
where "wks_FY16" represents financial year 2016.
I think difftime
should be useful, but I don't know how to specify the period that I need. I will be really grateful for your help on this.
ANSWER
Answered 2022-Mar-30 at 15:16We get the difference in 'weeks' using difftime
after making corrections for the '2016' year
1id <- c("A", "B", "B", "C", "D")
2start_date <- c("2014-08-18", "2014-08-04", "2016-10-10", "2016-04-01", "2015-12-31")
3end_date <- c("2018-09-01", "2019-09-22", "2016-10-18", "2016-05-01", "2016-04-08")
4
5df <- data.frame(id, start_date, end_date)
6
7 id start_date end_date
81 A 2014-08-18 2018-09-01
92 B 2014-08-04 2019-09-22
103 B 2016-10-10 2016-10-18
114 C 2016-04-01 2016-05-01
125 D 2015-12-31 2016-04-08
13 id start_date end_date wks_FY16
141 A 2014-08-18 2018-09-01 52
152 B 2014-08-04 2019-09-22 52
163 B 2016-10-10 2016-10-18 1
174 C 2016-04-01 2016-05-01 4
185 D 2015-12-31 2016-04-08 1
19library(dplyr)
20df %>%
21 mutate(across(start_date:end_date, as.Date),
22 wks_FY16 = as.integer(difftime(pmin(end_date,
23 as.Date('2017-03-31')), pmax(as.Date('2016-04-01'),
24 start_date), units = "weeks")))
25
QUESTION
Year and Text Parsing with Regex
Asked 2022-Mar-08 at 07:02I am trying to extract the data in the format of either Apr 2022 - Present + (the text after until the next date)
or Apr 1874 - Dec 1958 + (the text after until the next date)
from a text for later processing with NLP.
Example:
Apr 2018 - Present lm Senior NurseWoodfield Hospital, Ipswich© Provided daily care for 6 elderly patients after major surgical procedures inan ICU unit by monitoring vital signs and administering medication© Collaborated with doctors to develop long-term care plans after hospitalstays.Supervised 4 Certified Nursing Assistants (CNAs) working in the unitFeb 2014 - Mar 2018 mm Registered NurseAshfield Care Home, Kent© Worked with the unit manager to take care of 36 frail and elderly patientswith complex health needs.© Responsible for administering medicine safely, in accordance with theNursing Midwifery Council guidelines.© Managed the unit's revenue and budget, including the allocation of funds forpatient care, equipment, and staff supplies.Nov 2043 - Jan 2014 lm Healthcare AssistantChase Care Home, Suffolk« Responsible for the safety and well-being of elderly people with dementiaand challenging behaviour.Worked with palliative care teams to help deliver end of life care to patients.
Expected result: ["Apr 2018 - Present lm Senior NurseWoodfield Hospital, Ipswich© Provided daily care for 6 elderly patients after major surgical procedures inan ICU unit by monitoring vital signs and administering medication© Collaborated with doctors to develop long-term care plans after hospitalstays.Supervised 4 Certified Nursing Assistants (CNAs) working in the unitFeb", "Feb 2014 - Mar 2018 mm Registered NurseAshfield Care Home, Kent© Worked with the unit manager to take care of 36 frail and elderly patientswith complex health needs.© Responsible for administering medicine safely, in accordance with theNursing Midwifery Council guidelines.© Managed the unit's revenue and budget, including the allocation of funds forpatient care, equipment, and staff supplies", "Nov 2043 - Jan 2014 lm Healthcare AssistantChase Care Home, Suffolk« Responsible for the safety and well-being of elderly people with dementiaand challenging behaviour.Worked with palliative care teams to help deliver end of life care to patients."]
This is the code I wrote. I am having troubles fixing it
1year_pattern = re.compile(r"((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[.]?[\s-]\d{4}) - (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[.]?[\s-]\d{4} | (Present |present")
2
3year = ''.join(year_pattern.findall(text)).strip()
4
ANSWER
Answered 2022-Mar-08 at 01:44Probably not the best looking solution but this worked for me:
1year_pattern = re.compile(r"((?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[.]?[\s-]\d{4}) - (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[.]?[\s-]\d{4} | (Present |present")
2
3year = ''.join(year_pattern.findall(text)).strip()
4pattern = "(?=Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec|present|Present [0-9]{4} -)"
5splitted = re.split(pattern, text)
6print(splitted)
7result = []
8i = 0
9while i < len(splitted):
10 result.append(splitted[i] + splitted[i + 1])
11 i += 2
12
13print(result)
14
QUESTION
How to get list of all objects associated with a foreign key in Django
Asked 2022-Feb-20 at 05:11Not super experienced with Django so I apologize if this is trivial. Say I had a category instance and I wanted to get access to all of the content objects that I have previously added to my foreign key. How would I do so?
1class Organization(models.Model):
2 id = models.CharField(primary_key=True, max_length=200, default=uuid4, editable=False, unique=True)
3 name=models.CharField(max_length=200,unique=True)
4 phoneNumber=models.CharField(max_length=20)
5 logo=models.CharField(max_length=100000) # storing this as base 64 encoded
6 location=models.CharField(max_length=200)
7
8class Category(models.Model):
9 categoryName=models.CharField(max_length=300, unique=True, primary_key=True)
10 associatedOrganizations=models.ForeignKey(Organization,on_delete=models.CASCADE,related_name='associatedOrgs',null=True,blank=True)
11 associatedContent=models.ForeignKey(Content, on_delete=models.CASCADE,related_name='associatedContent',null=True,blank=True)
12 associatedMeetingNotices=models.ForeignKey(MeetingNotice,on_delete=models.CASCADE,related_name='associatedMeetingNotices',null=True,blank=True)
13
For example: say I had the following
1class Organization(models.Model):
2 id = models.CharField(primary_key=True, max_length=200, default=uuid4, editable=False, unique=True)
3 name=models.CharField(max_length=200,unique=True)
4 phoneNumber=models.CharField(max_length=20)
5 logo=models.CharField(max_length=100000) # storing this as base 64 encoded
6 location=models.CharField(max_length=200)
7
8class Category(models.Model):
9 categoryName=models.CharField(max_length=300, unique=True, primary_key=True)
10 associatedOrganizations=models.ForeignKey(Organization,on_delete=models.CASCADE,related_name='associatedOrgs',null=True,blank=True)
11 associatedContent=models.ForeignKey(Content, on_delete=models.CASCADE,related_name='associatedContent',null=True,blank=True)
12 associatedMeetingNotices=models.ForeignKey(MeetingNotice,on_delete=models.CASCADE,related_name='associatedMeetingNotices',null=True,blank=True)
13healthcareCategory=models.Category.objects.get(pk="healthcare")
14
and I wanted to access all Organizations related to healthcare, what should I do?
This?
1class Organization(models.Model):
2 id = models.CharField(primary_key=True, max_length=200, default=uuid4, editable=False, unique=True)
3 name=models.CharField(max_length=200,unique=True)
4 phoneNumber=models.CharField(max_length=20)
5 logo=models.CharField(max_length=100000) # storing this as base 64 encoded
6 location=models.CharField(max_length=200)
7
8class Category(models.Model):
9 categoryName=models.CharField(max_length=300, unique=True, primary_key=True)
10 associatedOrganizations=models.ForeignKey(Organization,on_delete=models.CASCADE,related_name='associatedOrgs',null=True,blank=True)
11 associatedContent=models.ForeignKey(Content, on_delete=models.CASCADE,related_name='associatedContent',null=True,blank=True)
12 associatedMeetingNotices=models.ForeignKey(MeetingNotice,on_delete=models.CASCADE,related_name='associatedMeetingNotices',null=True,blank=True)
13healthcareCategory=models.Category.objects.get(pk="healthcare")
14healthcareCategory.associatedOrganizations.all()
15
ANSWER
Answered 2022-Feb-20 at 03:31You are close. You may want to change that related name from associatedOrgs
to be associatedorgs
to follow more closely to the django coding style. Documentation on this has a few examples.
1class Organization(models.Model):
2 id = models.CharField(primary_key=True, max_length=200, default=uuid4, editable=False, unique=True)
3 name=models.CharField(max_length=200,unique=True)
4 phoneNumber=models.CharField(max_length=20)
5 logo=models.CharField(max_length=100000) # storing this as base 64 encoded
6 location=models.CharField(max_length=200)
7
8class Category(models.Model):
9 categoryName=models.CharField(max_length=300, unique=True, primary_key=True)
10 associatedOrganizations=models.ForeignKey(Organization,on_delete=models.CASCADE,related_name='associatedOrgs',null=True,blank=True)
11 associatedContent=models.ForeignKey(Content, on_delete=models.CASCADE,related_name='associatedContent',null=True,blank=True)
12 associatedMeetingNotices=models.ForeignKey(MeetingNotice,on_delete=models.CASCADE,related_name='associatedMeetingNotices',null=True,blank=True)
13healthcareCategory=models.Category.objects.get(pk="healthcare")
14healthcareCategory.associatedOrganizations.all()
15healthcare_category = Category.objects.get(pk="healthcare")
16organizations = healthcare_category.associatedorgs.all()
17
QUESTION
Looping through elements with Selenium and ChromeDriver
Asked 2022-Feb-11 at 23:21Im having trouble working through the following problem. Im trying to collect the data from the following webpage:https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM
My method is to use the Selenium chrome driver to collect the data, for each healthcare agent, off this webpage, but dont know how I would loop through each record and add the data to each created list. So far, I can collect the data for a single record, but my problem is with my loop. How would I identify each record as an agent, and add that to my data frame for output? here is my code:
1from selenium import webdriver # connect python with webbrowser-chrome
2import time
3import pandas as pd
4from selenium.webdriver.support.ui import WebDriverWait
5from selenium.webdriver.common.by import By
6from selenium.webdriver.support import expected_conditions as EC
7
8driver = webdriver.Chrome('C:/Users/picka/Documents/chromedriver.exe')
9driver.maximize_window()
10
11url = 'https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM'
12
13name = []
14phone = []
15email = []
16
17def go_to_network():
18 driver.get(url)
19
20 for agent in driver.find_elements_by_xpath('class.qa-flh-results-list'):
21
22 get_name = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "span.qa-flh-resource-name"))).text)
23 get_phone = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.qa-flh-resource-phone"))).text)
24 get_email = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.ds-u-overflow--hidden.ds-u-truncate.ds-u-display--inline-block"))).text)
25
26 name.append(get_name)
27 phone.append(get_phone)
28 email.append(get_email)
29
30
31go_to_network()
32
33
34record_output = {'Agent Name': name, 'Phone': phone, 'Email': email}
35df = pd.DataFrame(record_output)
36df.to_csv(r'C:\Users\picka\Documents\Dev\Reports\Agent-data.csv', header=True, index=False)
37print(df)
38
ANSWER
Answered 2022-Feb-11 at 23:21To extract and print all the Agent Name, Phone and Email using Selenium you can use List Comprehension inducing WebDriverWait for visibility_of_all_elements_located() and you can use either of the following Locator Strategies:
Code Block:
1from selenium import webdriver # connect python with webbrowser-chrome
2import time
3import pandas as pd
4from selenium.webdriver.support.ui import WebDriverWait
5from selenium.webdriver.common.by import By
6from selenium.webdriver.support import expected_conditions as EC
7
8driver = webdriver.Chrome('C:/Users/picka/Documents/chromedriver.exe')
9driver.maximize_window()
10
11url = 'https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM'
12
13name = []
14phone = []
15email = []
16
17def go_to_network():
18 driver.get(url)
19
20 for agent in driver.find_elements_by_xpath('class.qa-flh-results-list'):
21
22 get_name = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "span.qa-flh-resource-name"))).text)
23 get_phone = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.qa-flh-resource-phone"))).text)
24 get_email = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.ds-u-overflow--hidden.ds-u-truncate.ds-u-display--inline-block"))).text)
25
26 name.append(get_name)
27 phone.append(get_phone)
28 email.append(get_email)
29
30
31go_to_network()
32
33
34record_output = {'Agent Name': name, 'Phone': phone, 'Email': email}
35df = pd.DataFrame(record_output)
36df.to_csv(r'C:\Users\picka\Documents\Dev\Reports\Agent-data.csv', header=True, index=False)
37print(df)
38driver.get('https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM')
39get_name = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "span.qa-flh-resource-name")))]
40get_phone = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "a.qa-flh-resource-phone")))]
41get_email = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "a.ds-u-overflow--hidden.ds-u-truncate.ds-u-display--inline-block")))]
42for i,j,k in zip(get_name, get_phone, get_email):
43 print(f"{i}'s' phone number is {j} and email is {k}")
44driver.quit()
45
Console Output:
1from selenium import webdriver # connect python with webbrowser-chrome
2import time
3import pandas as pd
4from selenium.webdriver.support.ui import WebDriverWait
5from selenium.webdriver.common.by import By
6from selenium.webdriver.support import expected_conditions as EC
7
8driver = webdriver.Chrome('C:/Users/picka/Documents/chromedriver.exe')
9driver.maximize_window()
10
11url = 'https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM'
12
13name = []
14phone = []
15email = []
16
17def go_to_network():
18 driver.get(url)
19
20 for agent in driver.find_elements_by_xpath('class.qa-flh-results-list'):
21
22 get_name = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "span.qa-flh-resource-name"))).text)
23 get_phone = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.qa-flh-resource-phone"))).text)
24 get_email = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.ds-u-overflow--hidden.ds-u-truncate.ds-u-display--inline-block"))).text)
25
26 name.append(get_name)
27 phone.append(get_phone)
28 email.append(get_email)
29
30
31go_to_network()
32
33
34record_output = {'Agent Name': name, 'Phone': phone, 'Email': email}
35df = pd.DataFrame(record_output)
36df.to_csv(r'C:\Users\picka\Documents\Dev\Reports\Agent-data.csv', header=True, index=False)
37print(df)
38driver.get('https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM')
39get_name = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "span.qa-flh-resource-name")))]
40get_phone = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "a.qa-flh-resource-phone")))]
41get_email = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "a.ds-u-overflow--hidden.ds-u-truncate.ds-u-display--inline-block")))]
42for i,j,k in zip(get_name, get_phone, get_email):
43 print(f"{i}'s' phone number is {j} and email is {k}")
44driver.quit()
45Wesley Elton's' phone number is (801) 404 - 2424 and email is wes@wallbrokers.com
46Raquel Bell's' phone number is (801) 842 - 2870 and email is raquel.bell@enroll365.org
47Brandon Berglund's' phone number is (801) 981 - 9414 and email is Brandon@BerglundIns.com
48Steven Cochran's' phone number is (801) 800 - 8360 and email is steve.cochran@gbsbenefits.com
49victoria dang's' phone number is (801) 462 - 5190 and email is victoriawfg@yahoo.com
50Dan Jessop's' phone number is (435) 232 - 8833 and email is dejessop@hotmail.com
51Billy Gerdts's' phone number is (801) 280 - 1162 and email is bgerdts@gginsurancegroup.com
52Michael Saldana's' phone number is (801) 879 - 1032 and email is saldana.michael25@gmail.com
53Brandon Johnson's' phone number is (435) 249 - 0725 and email is brandon@msiagency.com
54Matthew Selph's' phone number is (801) 918 - 3945 and email is selph7@gmail.com
55
Note : You have to add the following imports :
1from selenium import webdriver # connect python with webbrowser-chrome
2import time
3import pandas as pd
4from selenium.webdriver.support.ui import WebDriverWait
5from selenium.webdriver.common.by import By
6from selenium.webdriver.support import expected_conditions as EC
7
8driver = webdriver.Chrome('C:/Users/picka/Documents/chromedriver.exe')
9driver.maximize_window()
10
11url = 'https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM'
12
13name = []
14phone = []
15email = []
16
17def go_to_network():
18 driver.get(url)
19
20 for agent in driver.find_elements_by_xpath('class.qa-flh-results-list'):
21
22 get_name = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "span.qa-flh-resource-name"))).text)
23 get_phone = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.qa-flh-resource-phone"))).text)
24 get_email = (WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "a.ds-u-overflow--hidden.ds-u-truncate.ds-u-display--inline-block"))).text)
25
26 name.append(get_name)
27 phone.append(get_phone)
28 email.append(get_email)
29
30
31go_to_network()
32
33
34record_output = {'Agent Name': name, 'Phone': phone, 'Email': email}
35df = pd.DataFrame(record_output)
36df.to_csv(r'C:\Users\picka\Documents\Dev\Reports\Agent-data.csv', header=True, index=False)
37print(df)
38driver.get('https://localhelp.healthcare.gov/#/results?q=UTAH&lat=0&lng=0&city=&state=UT&zip_code=&mp=FFM')
39get_name = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "span.qa-flh-resource-name")))]
40get_phone = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "a.qa-flh-resource-phone")))]
41get_email = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, "a.ds-u-overflow--hidden.ds-u-truncate.ds-u-display--inline-block")))]
42for i,j,k in zip(get_name, get_phone, get_email):
43 print(f"{i}'s' phone number is {j} and email is {k}")
44driver.quit()
45Wesley Elton's' phone number is (801) 404 - 2424 and email is wes@wallbrokers.com
46Raquel Bell's' phone number is (801) 842 - 2870 and email is raquel.bell@enroll365.org
47Brandon Berglund's' phone number is (801) 981 - 9414 and email is Brandon@BerglundIns.com
48Steven Cochran's' phone number is (801) 800 - 8360 and email is steve.cochran@gbsbenefits.com
49victoria dang's' phone number is (801) 462 - 5190 and email is victoriawfg@yahoo.com
50Dan Jessop's' phone number is (435) 232 - 8833 and email is dejessop@hotmail.com
51Billy Gerdts's' phone number is (801) 280 - 1162 and email is bgerdts@gginsurancegroup.com
52Michael Saldana's' phone number is (801) 879 - 1032 and email is saldana.michael25@gmail.com
53Brandon Johnson's' phone number is (435) 249 - 0725 and email is brandon@msiagency.com
54Matthew Selph's' phone number is (801) 918 - 3945 and email is selph7@gmail.com
55from selenium.webdriver.support.ui import WebDriverWait
56from selenium.webdriver.common.by import By
57from selenium.webdriver.support import expected_conditions as EC
58
QUESTION
MongoDB - Querying inner object that is an array
Asked 2022-Feb-07 at 19:04I am new to MongoDB queries and looking for some guidance on how to retrieve documents that fit the search criteria. In particular, I need to find all the id(s) of the documents where the code is JPID i.e, "code": "JPID". We can assume the name of the collection is systems.
Since this is a nested object I thought of using the $unwid - but I am still stuck on how to do it. The example is very trivial. Any help and guidance is appreciated.
1{
2 "resourceType": "NamingSystem",
3 "id": "example-id",
4 "name": "Austalian Healthcare Identifier - Individual",
5 "status": "active",
6 "kind": "identifier",
7 "date": "2015-08-31",
8 "publisher": "HL7 Australia on behalf of NEHTA",
9 "responsible": "HI Service Operator / NEHTA",
10 "type": {
11 "coding": [
12 {
13 "system": "http://hl7.org/fhir/v2/0203",
14 "code": "JPID";
15 "display": "National unique individual identifier"
16 }
17 ],
18 "text": "IHI"
19 },
20 "description": "Australian HI Identifier as established by relevant regulations etc",
21 "uniqueId": [
22 {
23 "type": "oid",
24 "value": "1.2.36.1.2001.1003.0",
25 "comment": "This value is used in Australian CDA documents"
26 },
27 {
28 "type": "uri",
29 "value": "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
30 "preferred": true,
31 "period": {
32 "start": "2015-08-21"
33 }
34 }
35 ]
36 }
37
ANSWER
Answered 2022-Feb-07 at 19:04You can find all documents that contain at least one element in type.coding array by simple match the code element with the value JPID:
1{
2 "resourceType": "NamingSystem",
3 "id": "example-id",
4 "name": "Austalian Healthcare Identifier - Individual",
5 "status": "active",
6 "kind": "identifier",
7 "date": "2015-08-31",
8 "publisher": "HL7 Australia on behalf of NEHTA",
9 "responsible": "HI Service Operator / NEHTA",
10 "type": {
11 "coding": [
12 {
13 "system": "http://hl7.org/fhir/v2/0203",
14 "code": "JPID";
15 "display": "National unique individual identifier"
16 }
17 ],
18 "text": "IHI"
19 },
20 "description": "Australian HI Identifier as established by relevant regulations etc",
21 "uniqueId": [
22 {
23 "type": "oid",
24 "value": "1.2.36.1.2001.1003.0",
25 "comment": "This value is used in Australian CDA documents"
26 },
27 {
28 "type": "uri",
29 "value": "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
30 "preferred": true,
31 "period": {
32 "start": "2015-08-21"
33 }
34 }
35 ]
36 }
37db.system.find({
38 "type.coding.code": "JPID"
39})
40
It is recommended to create and index on {"type.coding.code":1} so your searches to perform faster on this field.
If you need to find all documents and filter only the array entries having the code:"JPID" you can use $filter as follow:
1{
2 "resourceType": "NamingSystem",
3 "id": "example-id",
4 "name": "Austalian Healthcare Identifier - Individual",
5 "status": "active",
6 "kind": "identifier",
7 "date": "2015-08-31",
8 "publisher": "HL7 Australia on behalf of NEHTA",
9 "responsible": "HI Service Operator / NEHTA",
10 "type": {
11 "coding": [
12 {
13 "system": "http://hl7.org/fhir/v2/0203",
14 "code": "JPID";
15 "display": "National unique individual identifier"
16 }
17 ],
18 "text": "IHI"
19 },
20 "description": "Australian HI Identifier as established by relevant regulations etc",
21 "uniqueId": [
22 {
23 "type": "oid",
24 "value": "1.2.36.1.2001.1003.0",
25 "comment": "This value is used in Australian CDA documents"
26 },
27 {
28 "type": "uri",
29 "value": "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
30 "preferred": true,
31 "period": {
32 "start": "2015-08-21"
33 }
34 }
35 ]
36 }
37db.system.find({
38 "type.coding.code": "JPID"
39})
40db.system.aggregate([
41{
42 $match: {
43 "type.coding.code": "JPID"
44 }
45},
46{
47 $addFields: {
48 "type.coding": {
49 "$filter": {
50 "input": "$type.coding",
51 "as": "tc",
52 "cond": {
53 $eq: [
54 "$$tc.code",
55 "JPID"
56 ]
57 }
58 }
59 }
60 }
61}
62])
63
QUESTION
Dockerize Flask: Error: While importing 'app', an ImportError was raised
Asked 2022-Jan-10 at 17:09I am trying to dockerize my Flask API. As soon as I try to start my image I receive the message:
1* Environment: production
2WARNING: This is a development server. Do not use it in a production deployment.
3Use a production WSGI server instead.
4* Debug mode: off
5Usage: python -m flask run [OPTIONS]
6Try 'python -m flask run --help' for help.
7
8Error: While importing 'app', an ImportError was raised.
9
If I am starting the Flask App with my terminal python -m flask run
everything works like intended.
And right now I am stuck on this problem.
Here is my Code:
1* Environment: production
2WARNING: This is a development server. Do not use it in a production deployment.
3Use a production WSGI server instead.
4* Debug mode: off
5Usage: python -m flask run [OPTIONS]
6Try 'python -m flask run --help' for help.
7
8Error: While importing 'app', an ImportError was raised.
9from flask import Flask
10from bson import json_util
11from flask_pymongo import PyMongo
12from flask_cors import CORS
13import json
14
15app = Flask(__name__)
16app.config["MONGO_URI"] = "mongodb://194.163.147.192:27017/test"
17CORS(app)
18mongo = PyMongo(app)
19
20
21def parse_json(data):
22 return json.loads(json_util.dumps(data))
23
24
25@app.route('/')
26def home():
27 return 'Hello'
28
29
30@app.route('/residential', methods=['GET'])
31def find_residential(): # put application's code here
32 test = mongo.db.acs.find_one({"name": "Residential"})
33 response = Flask.jsonify(parse_json(test))
34 response.headers.add('Access-Control-Allow-Origin', '*')
35 return response
36
37
38@app.route('/commercial', methods=['GET'])
39def find_commercial(): # put application's code here
40 test = mongo.db.acs.find_one({"name": "Commercial"})
41 response = Flask.jsonify(parse_json(test))
42 response.headers.add('Access-Control-Allow-Origin', '*')
43 return response
44
45
46@app.route('/healthcare', methods=['GET'])
47def find_health_care(): # put application's code here
48 test = mongo.db.acs.find_one({"name": "Health Care"})
49 response = Flask.jsonify(parse_json(test))
50 response.headers.add('Access-Control-Allow-Origin', '*')
51 return response
52
53
54@app.route('/germany', methods=['GET'])
55def find_germany():
56 test = mongo.db.germanies.find_one()
57 response = Flask.jsonify(parse_json(test))
58 response.headers.add('Access-Control-Allow-Origin', '*')
59 return response
60
61
62if __name__ == '__main__':
63 app.debug = False
64 app.run()
65
My requirements.txt looks like this
1* Environment: production
2WARNING: This is a development server. Do not use it in a production deployment.
3Use a production WSGI server instead.
4* Debug mode: off
5Usage: python -m flask run [OPTIONS]
6Try 'python -m flask run --help' for help.
7
8Error: While importing 'app', an ImportError was raised.
9from flask import Flask
10from bson import json_util
11from flask_pymongo import PyMongo
12from flask_cors import CORS
13import json
14
15app = Flask(__name__)
16app.config["MONGO_URI"] = "mongodb://194.163.147.192:27017/test"
17CORS(app)
18mongo = PyMongo(app)
19
20
21def parse_json(data):
22 return json.loads(json_util.dumps(data))
23
24
25@app.route('/')
26def home():
27 return 'Hello'
28
29
30@app.route('/residential', methods=['GET'])
31def find_residential(): # put application's code here
32 test = mongo.db.acs.find_one({"name": "Residential"})
33 response = Flask.jsonify(parse_json(test))
34 response.headers.add('Access-Control-Allow-Origin', '*')
35 return response
36
37
38@app.route('/commercial', methods=['GET'])
39def find_commercial(): # put application's code here
40 test = mongo.db.acs.find_one({"name": "Commercial"})
41 response = Flask.jsonify(parse_json(test))
42 response.headers.add('Access-Control-Allow-Origin', '*')
43 return response
44
45
46@app.route('/healthcare', methods=['GET'])
47def find_health_care(): # put application's code here
48 test = mongo.db.acs.find_one({"name": "Health Care"})
49 response = Flask.jsonify(parse_json(test))
50 response.headers.add('Access-Control-Allow-Origin', '*')
51 return response
52
53
54@app.route('/germany', methods=['GET'])
55def find_germany():
56 test = mongo.db.germanies.find_one()
57 response = Flask.jsonify(parse_json(test))
58 response.headers.add('Access-Control-Allow-Origin', '*')
59 return response
60
61
62if __name__ == '__main__':
63 app.debug = False
64 app.run()
65bson==0.5.10
66click==8.0.3
67colorama==0.4.4
68Flask==2.0.2
69Flask-Cors==3.0.10
70Flask-PyMongo==2.3.0
71itsdangerous==2.0.1
72Jinja2==3.0.2
73MarkupSafe==2.0.1
74pymongo==3.12.1
75python-dateutil==2.8.2
76six==1.16.0
77Werkzeug==2.0.2
78
My Dockerfile looks like this
1* Environment: production
2WARNING: This is a development server. Do not use it in a production deployment.
3Use a production WSGI server instead.
4* Debug mode: off
5Usage: python -m flask run [OPTIONS]
6Try 'python -m flask run --help' for help.
7
8Error: While importing 'app', an ImportError was raised.
9from flask import Flask
10from bson import json_util
11from flask_pymongo import PyMongo
12from flask_cors import CORS
13import json
14
15app = Flask(__name__)
16app.config["MONGO_URI"] = "mongodb://194.163.147.192:27017/test"
17CORS(app)
18mongo = PyMongo(app)
19
20
21def parse_json(data):
22 return json.loads(json_util.dumps(data))
23
24
25@app.route('/')
26def home():
27 return 'Hello'
28
29
30@app.route('/residential', methods=['GET'])
31def find_residential(): # put application's code here
32 test = mongo.db.acs.find_one({"name": "Residential"})
33 response = Flask.jsonify(parse_json(test))
34 response.headers.add('Access-Control-Allow-Origin', '*')
35 return response
36
37
38@app.route('/commercial', methods=['GET'])
39def find_commercial(): # put application's code here
40 test = mongo.db.acs.find_one({"name": "Commercial"})
41 response = Flask.jsonify(parse_json(test))
42 response.headers.add('Access-Control-Allow-Origin', '*')
43 return response
44
45
46@app.route('/healthcare', methods=['GET'])
47def find_health_care(): # put application's code here
48 test = mongo.db.acs.find_one({"name": "Health Care"})
49 response = Flask.jsonify(parse_json(test))
50 response.headers.add('Access-Control-Allow-Origin', '*')
51 return response
52
53
54@app.route('/germany', methods=['GET'])
55def find_germany():
56 test = mongo.db.germanies.find_one()
57 response = Flask.jsonify(parse_json(test))
58 response.headers.add('Access-Control-Allow-Origin', '*')
59 return response
60
61
62if __name__ == '__main__':
63 app.debug = False
64 app.run()
65bson==0.5.10
66click==8.0.3
67colorama==0.4.4
68Flask==2.0.2
69Flask-Cors==3.0.10
70Flask-PyMongo==2.3.0
71itsdangerous==2.0.1
72Jinja2==3.0.2
73MarkupSafe==2.0.1
74pymongo==3.12.1
75python-dateutil==2.8.2
76six==1.16.0
77Werkzeug==2.0.2
78FROM python:3.8-slim-buster
79WORKDIR /api
80COPY requirements.txt requirements.txt
81RUN pip3 install -r requirements.txt
82COPY . .
83CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]
84
I am thankful for any help :)
Project structure is like:
1* Environment: production
2WARNING: This is a development server. Do not use it in a production deployment.
3Use a production WSGI server instead.
4* Debug mode: off
5Usage: python -m flask run [OPTIONS]
6Try 'python -m flask run --help' for help.
7
8Error: While importing 'app', an ImportError was raised.
9from flask import Flask
10from bson import json_util
11from flask_pymongo import PyMongo
12from flask_cors import CORS
13import json
14
15app = Flask(__name__)
16app.config["MONGO_URI"] = "mongodb://194.163.147.192:27017/test"
17CORS(app)
18mongo = PyMongo(app)
19
20
21def parse_json(data):
22 return json.loads(json_util.dumps(data))
23
24
25@app.route('/')
26def home():
27 return 'Hello'
28
29
30@app.route('/residential', methods=['GET'])
31def find_residential(): # put application's code here
32 test = mongo.db.acs.find_one({"name": "Residential"})
33 response = Flask.jsonify(parse_json(test))
34 response.headers.add('Access-Control-Allow-Origin', '*')
35 return response
36
37
38@app.route('/commercial', methods=['GET'])
39def find_commercial(): # put application's code here
40 test = mongo.db.acs.find_one({"name": "Commercial"})
41 response = Flask.jsonify(parse_json(test))
42 response.headers.add('Access-Control-Allow-Origin', '*')
43 return response
44
45
46@app.route('/healthcare', methods=['GET'])
47def find_health_care(): # put application's code here
48 test = mongo.db.acs.find_one({"name": "Health Care"})
49 response = Flask.jsonify(parse_json(test))
50 response.headers.add('Access-Control-Allow-Origin', '*')
51 return response
52
53
54@app.route('/germany', methods=['GET'])
55def find_germany():
56 test = mongo.db.germanies.find_one()
57 response = Flask.jsonify(parse_json(test))
58 response.headers.add('Access-Control-Allow-Origin', '*')
59 return response
60
61
62if __name__ == '__main__':
63 app.debug = False
64 app.run()
65bson==0.5.10
66click==8.0.3
67colorama==0.4.4
68Flask==2.0.2
69Flask-Cors==3.0.10
70Flask-PyMongo==2.3.0
71itsdangerous==2.0.1
72Jinja2==3.0.2
73MarkupSafe==2.0.1
74pymongo==3.12.1
75python-dateutil==2.8.2
76six==1.16.0
77Werkzeug==2.0.2
78FROM python:3.8-slim-buster
79WORKDIR /api
80COPY requirements.txt requirements.txt
81RUN pip3 install -r requirements.txt
82COPY . .
83CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]
84API
85L venv
86L app.py
87L Dockerfile
88L requirements.txt
89
ANSWER
Answered 2021-Nov-02 at 20:53Your issue is, I think, with your requirements file. In that you include bson
as a dependency, which is also included in the pymongo
library. See this question. Removing it seems to solve the issue:
1* Environment: production
2WARNING: This is a development server. Do not use it in a production deployment.
3Use a production WSGI server instead.
4* Debug mode: off
5Usage: python -m flask run [OPTIONS]
6Try 'python -m flask run --help' for help.
7
8Error: While importing 'app', an ImportError was raised.
9from flask import Flask
10from bson import json_util
11from flask_pymongo import PyMongo
12from flask_cors import CORS
13import json
14
15app = Flask(__name__)
16app.config["MONGO_URI"] = "mongodb://194.163.147.192:27017/test"
17CORS(app)
18mongo = PyMongo(app)
19
20
21def parse_json(data):
22 return json.loads(json_util.dumps(data))
23
24
25@app.route('/')
26def home():
27 return 'Hello'
28
29
30@app.route('/residential', methods=['GET'])
31def find_residential(): # put application's code here
32 test = mongo.db.acs.find_one({"name": "Residential"})
33 response = Flask.jsonify(parse_json(test))
34 response.headers.add('Access-Control-Allow-Origin', '*')
35 return response
36
37
38@app.route('/commercial', methods=['GET'])
39def find_commercial(): # put application's code here
40 test = mongo.db.acs.find_one({"name": "Commercial"})
41 response = Flask.jsonify(parse_json(test))
42 response.headers.add('Access-Control-Allow-Origin', '*')
43 return response
44
45
46@app.route('/healthcare', methods=['GET'])
47def find_health_care(): # put application's code here
48 test = mongo.db.acs.find_one({"name": "Health Care"})
49 response = Flask.jsonify(parse_json(test))
50 response.headers.add('Access-Control-Allow-Origin', '*')
51 return response
52
53
54@app.route('/germany', methods=['GET'])
55def find_germany():
56 test = mongo.db.germanies.find_one()
57 response = Flask.jsonify(parse_json(test))
58 response.headers.add('Access-Control-Allow-Origin', '*')
59 return response
60
61
62if __name__ == '__main__':
63 app.debug = False
64 app.run()
65bson==0.5.10
66click==8.0.3
67colorama==0.4.4
68Flask==2.0.2
69Flask-Cors==3.0.10
70Flask-PyMongo==2.3.0
71itsdangerous==2.0.1
72Jinja2==3.0.2
73MarkupSafe==2.0.1
74pymongo==3.12.1
75python-dateutil==2.8.2
76six==1.16.0
77Werkzeug==2.0.2
78FROM python:3.8-slim-buster
79WORKDIR /api
80COPY requirements.txt requirements.txt
81RUN pip3 install -r requirements.txt
82COPY . .
83CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]
84API
85L venv
86L app.py
87L Dockerfile
88L requirements.txt
89 ~/tmp/so_q $ docker build -t myimage . 8s nathanielford@nford 20:51:04
90Sending build context to Docker daemon 5.12kB
91
92...
93
94Successfully tagged myimage:latest
95 ~/tmp/so_q $ docker run myimage 13s nathanielford@nford 20:51:26
96 * Environment: production
97 WARNING: This is a development server. Do not use it in a production deployment.
98 Use a production WSGI server instead.
99 * Debug mode: off
100 * Running on all addresses.
101 WARNING: This is a development server. Do not use it in a production deployment.
102 * Running on http://192.168.9.2:5000/ (Press CTRL+C to quit)
103
QUESTION
search unique element pairs and transform sorted result to JSON
Asked 2022-Jan-06 at 01:12I have below sample input: (They are individual documents)
1 <performance>
2 <year>2016</year>
3 <industry>Financials</industry>
4 <benchmark>Healthcare</benchmark>
5</performance>
6
7 <performance>
8 <year>2017</year>
9 <industry>Technology</industry>
10 <benchmark>Financials</benchmark>
11</performance>
12
13 <performance>
14 <year>2018</year>
15 <industry>Technology</industry>
16 <benchmark>Financials</benchmark>
17</performance>
18
19 <performance>
20 <year>2019</year>
21 <industry>Financials</industry>
22 <benchmark>Materials</benchmark>
23</performance>
24
25 <performance>
26 <year>2020</year>
27 <industry>Technology</industry>
28 <benchmark>Materials</benchmark>
29</performance>
30
31 <performance>
32 <year>2021</year>
33 <industry>Technology</industry>
34 <benchmark>Healthcare</benchmark>
35 </performance>
36
I need to find the industry and benchmark pairs, sort the result document on year, and finally transform the pairs to JSON. I would like to use Marklogic’s index to speed up search and transform. The expected output is:
1 <performance>
2 <year>2016</year>
3 <industry>Financials</industry>
4 <benchmark>Healthcare</benchmark>
5</performance>
6
7 <performance>
8 <year>2017</year>
9 <industry>Technology</industry>
10 <benchmark>Financials</benchmark>
11</performance>
12
13 <performance>
14 <year>2018</year>
15 <industry>Technology</industry>
16 <benchmark>Financials</benchmark>
17</performance>
18
19 <performance>
20 <year>2019</year>
21 <industry>Financials</industry>
22 <benchmark>Materials</benchmark>
23</performance>
24
25 <performance>
26 <year>2020</year>
27 <industry>Technology</industry>
28 <benchmark>Materials</benchmark>
29</performance>
30
31 <performance>
32 <year>2021</year>
33 <industry>Technology</industry>
34 <benchmark>Healthcare</benchmark>
35 </performance>
36 {
37 "Financials": [
38"Materials",
39"Healthcare"
40 ],
41 "Technology": [
42"Healthcare",
43"Materials",
44"Financials"
45 ]
46 }
47
My Xquery code:
1 <performance>
2 <year>2016</year>
3 <industry>Financials</industry>
4 <benchmark>Healthcare</benchmark>
5</performance>
6
7 <performance>
8 <year>2017</year>
9 <industry>Technology</industry>
10 <benchmark>Financials</benchmark>
11</performance>
12
13 <performance>
14 <year>2018</year>
15 <industry>Technology</industry>
16 <benchmark>Financials</benchmark>
17</performance>
18
19 <performance>
20 <year>2019</year>
21 <industry>Financials</industry>
22 <benchmark>Materials</benchmark>
23</performance>
24
25 <performance>
26 <year>2020</year>
27 <industry>Technology</industry>
28 <benchmark>Materials</benchmark>
29</performance>
30
31 <performance>
32 <year>2021</year>
33 <industry>Technology</industry>
34 <benchmark>Healthcare</benchmark>
35 </performance>
36 {
37 "Financials": [
38"Materials",
39"Healthcare"
40 ],
41 "Technology": [
42"Healthcare",
43"Materials",
44"Financials"
45 ]
46 }
47let $keys := ('Financials', 'Technology')
48let $map := map:map()
49let $_ :=
50 for $key in $keys
51 let $query := cts:path-range-query("/performance/industry", "=", $key)
52 let $v := cts:values(cts:path-reference('/performance/benchmark'), (), (), $query)
53 return map:put($map, $key, $v)
54return xdmp:to-json($map)
55
Unexpected output:
1 <performance>
2 <year>2016</year>
3 <industry>Financials</industry>
4 <benchmark>Healthcare</benchmark>
5</performance>
6
7 <performance>
8 <year>2017</year>
9 <industry>Technology</industry>
10 <benchmark>Financials</benchmark>
11</performance>
12
13 <performance>
14 <year>2018</year>
15 <industry>Technology</industry>
16 <benchmark>Financials</benchmark>
17</performance>
18
19 <performance>
20 <year>2019</year>
21 <industry>Financials</industry>
22 <benchmark>Materials</benchmark>
23</performance>
24
25 <performance>
26 <year>2020</year>
27 <industry>Technology</industry>
28 <benchmark>Materials</benchmark>
29</performance>
30
31 <performance>
32 <year>2021</year>
33 <industry>Technology</industry>
34 <benchmark>Healthcare</benchmark>
35 </performance>
36 {
37 "Financials": [
38"Materials",
39"Healthcare"
40 ],
41 "Technology": [
42"Healthcare",
43"Materials",
44"Financials"
45 ]
46 }
47let $keys := ('Financials', 'Technology')
48let $map := map:map()
49let $_ :=
50 for $key in $keys
51 let $query := cts:path-range-query("/performance/industry", "=", $key)
52 let $v := cts:values(cts:path-reference('/performance/benchmark'), (), (), $query)
53 return map:put($map, $key, $v)
54return xdmp:to-json($map)
55{
56"Financials":[
57 "Healthcare",
58 "Materials"
59],
60"Technology":[
61 "Financials",
62 "Healthcare",
63 "Materials"
64]
65}
66
Do I use Xquery in the wrong way or misunderstand how the Marklogic index works? How can I get the correct output? I am fine with Javascript or Xquery.
ANSWER
Answered 2021-Dec-18 at 22:29It seems that when you put a sequence of values in the map, they wind up being sorted.
With this solution, I fetch all of the benchmark
and year
for each industry
, sort the values in descending
order by year
, dedup with distinct-values()
and then put them into an array-object()
in order to maintain the sorted order.
1 <performance>
2 <year>2016</year>
3 <industry>Financials</industry>
4 <benchmark>Healthcare</benchmark>
5</performance>
6
7 <performance>
8 <year>2017</year>
9 <industry>Technology</industry>
10 <benchmark>Financials</benchmark>
11</performance>
12
13 <performance>
14 <year>2018</year>
15 <industry>Technology</industry>
16 <benchmark>Financials</benchmark>
17</performance>
18
19 <performance>
20 <year>2019</year>
21 <industry>Financials</industry>
22 <benchmark>Materials</benchmark>
23</performance>
24
25 <performance>
26 <year>2020</year>
27 <industry>Technology</industry>
28 <benchmark>Materials</benchmark>
29</performance>
30
31 <performance>
32 <year>2021</year>
33 <industry>Technology</industry>
34 <benchmark>Healthcare</benchmark>
35 </performance>
36 {
37 "Financials": [
38"Materials",
39"Healthcare"
40 ],
41 "Technology": [
42"Healthcare",
43"Materials",
44"Financials"
45 ]
46 }
47let $keys := ('Financials', 'Technology')
48let $map := map:map()
49let $_ :=
50 for $key in $keys
51 let $query := cts:path-range-query("/performance/industry", "=", $key)
52 let $v := cts:values(cts:path-reference('/performance/benchmark'), (), (), $query)
53 return map:put($map, $key, $v)
54return xdmp:to-json($map)
55{
56"Financials":[
57 "Healthcare",
58 "Materials"
59],
60"Technology":[
61 "Financials",
62 "Healthcare",
63 "Materials"
64]
65}
66let $map := map:map()
67let $industries := ('Financials', 'Technology')
68let $_ :=
69 for $industry in $industries
70 let $query := cts:path-range-query("/performance/industry", "=", $industry)
71 let $tuples := cts:value-tuples((cts:path-reference('/performance/benchmark'), cts:path-reference('/performance/year')), (), $query)
72 let $sorted-values :=
73 for $tuple in $tuples
74 let $benchmark := $tuple[1]
75 let $year := $tuple[2]
76 order by $year descending
77 return $benchmark
78 return map:put($map, $industry, array-node{ distinct-values($sorted-values) })
79return xdmp:to-json($map)
80
QUESTION
Clean trailing period if present as last non whitespace of dataframe column
Asked 2021-Dec-23 at 08:18Here's a sample of the data I'm working on(first line are the column names):
1DENOMINAZIONE;ATC;PRINCIPIO ATTIVO;TITOLARE;AIC
2ABASAGLAR;A10AE04;INSULINA GLARGINE;ELI LILLY NEDERLAND B.V.;043658
3ABASRIA;A10AE04;INSULIN GLARGINE;ELI LILLY REGIONAL OPERATIONS GMBH.;043658
4 ABECMA;L01;IDECABTAGENE VICLEUCEL;CELGENE EUROPE BV;049604
5ABEVMY;L01XC07;BEVACIZUMAB;MYLAN IRE HEALTHCARE LTD ;049452
6ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD. ;043143
7ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD;043143
8
and I need to eliminate the last '.' so that for example the last two lines become identical. I also need to take into account that sometimes there are leading or trailing whitespaces, possibly more than one.
The CSV file is read into a Pandas.DataFrame comp_df on which I tried the following line:
1DENOMINAZIONE;ATC;PRINCIPIO ATTIVO;TITOLARE;AIC
2ABASAGLAR;A10AE04;INSULINA GLARGINE;ELI LILLY NEDERLAND B.V.;043658
3ABASRIA;A10AE04;INSULIN GLARGINE;ELI LILLY REGIONAL OPERATIONS GMBH.;043658
4 ABECMA;L01;IDECABTAGENE VICLEUCEL;CELGENE EUROPE BV;049604
5ABEVMY;L01XC07;BEVACIZUMAB;MYLAN IRE HEALTHCARE LTD ;049452
6ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD. ;043143
7ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD;043143
8comp_df.TITOLARE.str.replace(r".+\.\s*$", "", regex=True)
9
which does its job of matching one or more non whitespace chars followed by a literal period followed by zero or more spaces until the end of line is reached.
My objective is to lessen the variability of the strings in the TITOLARE series.
The problem is that the lines that match are correctly substituted but the non matching lines are returned as empty.
How do I fix this?
ANSWER
Answered 2021-Dec-23 at 08:18I can not reproduce why the non matching lines are returned as empty, but if you load the example data as csv, set the separator to ;
and only match the dot at the end of the string using between optional whitespace chars using \s*\.\s*$
you will get the desired replacement leaving unmatched lines untouched.
Example
1DENOMINAZIONE;ATC;PRINCIPIO ATTIVO;TITOLARE;AIC
2ABASAGLAR;A10AE04;INSULINA GLARGINE;ELI LILLY NEDERLAND B.V.;043658
3ABASRIA;A10AE04;INSULIN GLARGINE;ELI LILLY REGIONAL OPERATIONS GMBH.;043658
4 ABECMA;L01;IDECABTAGENE VICLEUCEL;CELGENE EUROPE BV;049604
5ABEVMY;L01XC07;BEVACIZUMAB;MYLAN IRE HEALTHCARE LTD ;049452
6ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD. ;043143
7ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD;043143
8comp_df.TITOLARE.str.replace(r".+\.\s*$", "", regex=True)
9import pandas as pd
10
11comp_df = pd.read_csv("file.csv", sep=";")
12comp_df.TITOLARE = comp_df.TITOLARE.str.replace(r"\s*\.\s*$", "")
13
14print(comp_df)
15
Output
1DENOMINAZIONE;ATC;PRINCIPIO ATTIVO;TITOLARE;AIC
2ABASAGLAR;A10AE04;INSULINA GLARGINE;ELI LILLY NEDERLAND B.V.;043658
3ABASRIA;A10AE04;INSULIN GLARGINE;ELI LILLY REGIONAL OPERATIONS GMBH.;043658
4 ABECMA;L01;IDECABTAGENE VICLEUCEL;CELGENE EUROPE BV;049604
5ABEVMY;L01XC07;BEVACIZUMAB;MYLAN IRE HEALTHCARE LTD ;049452
6ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD. ;043143
7ABILIFY MAINTENA;N05AX12;ARIPIPRAZOLE;OTSUKA PHARMACEUTICAL EUROPE LTD;043143
8comp_df.TITOLARE.str.replace(r".+\.\s*$", "", regex=True)
9import pandas as pd
10
11comp_df = pd.read_csv("file.csv", sep=";")
12comp_df.TITOLARE = comp_df.TITOLARE.str.replace(r"\s*\.\s*$", "")
13
14print(comp_df)
15 DENOMINAZIONE ATC PRINCIPIO ATTIVO TITOLARE AIC
160 ABASAGLAR A10AE04 INSULINA GLARGINE ELI LILLY NEDERLAND B.V 43658
171 ABASRIA A10AE04 INSULIN GLARGINE ELI LILLY REGIONAL OPERATIONS GMBH 43658
182 ABECMA L01 IDECABTAGENE VICLEUCEL CELGENE EUROPE BV 49604
193 ABEVMY L01XC07 BEVACIZUMAB MYLAN IRE HEALTHCARE LTD 49452
204 ABILIFY MAINTENA N05AX12 ARIPIPRAZOLE OTSUKA PHARMACEUTICAL EUROPE LTD 43143
215 ABILIFY MAINTENA N05AX12 ARIPIPRAZOLE OTSUKA PHARMACEUTICAL EUROPE LTD 43143
22
QUESTION
Passing several fields if meets a criteria to a Hidden Form Field
Asked 2021-Dec-06 at 18:09I need to pass multiple filled values to a hidden form field using javascript/jquery. The fields must have a value or don't pass. I can pass the regular text fields with no problem but the checkbox and radio fields always seem to get me. Javascript is not my expertise so I'm willing to learn. Thanks in advance.
The values we are wanting to capture are:
- Questions/comments
- Product Interests (this can be multiple values)
- Industry
- Number of Employees
- Multiple Locations if "true".
Each item will be separated by a pipe character.
1$(document).ready(function() {
2 $(function(){ $('#13005,#14604').on("keyup",function(){
3 commentField = $("#13005").val(); + " || "
4 products = $("p.Custom_LR_FormServices input:checkbox:checked").map(function(){return $(this).val()}).get();
5 industryField = $("p.RAQFormIndustry input:checkbox:checked").map(function(){return $(this).val()}).get();
6 numberEmployees = $;
7 multipleLocations = $;
8 hiddenField = commentField + " || " + products + " || " + industryField + "||" + numberEmployees + " || " + multipleLocations;
9 $("#14604").val(hiddenField);
10 });
11 });
12 });
1$(document).ready(function() {
2 $(function(){ $('#13005,#14604').on("keyup",function(){
3 commentField = $("#13005").val(); + " || "
4 products = $("p.Custom_LR_FormServices input:checkbox:checked").map(function(){return $(this).val()}).get();
5 industryField = $("p.RAQFormIndustry input:checkbox:checked").map(function(){return $(this).val()}).get();
6 numberEmployees = $;
7 multipleLocations = $;
8 hiddenField = commentField + " || " + products + " || " + industryField + "||" + numberEmployees + " || " + multipleLocations;
9 $("#14604").val(hiddenField);
10 });
11 });
12 });<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
13<p class="email pd-text required ">
14 <label class="field-label" for="12993">Email</label>
15 <input type="text" name="12993" id="12993" value="" class="text" size="30" maxlength="255" onfocus="" />
16</p>
17
18<p class="company pd-text required ">
19 <label class="field-label" for="12995">Business Name</label>
20 <input type="text" name="12995" id="12995" value="" class="text" size="30" maxlength="255" onchange="" onfocus="" />
21</p>
22
23<p class="comments pd-textarea ">
24 <label class="field-label" for="13005">Comments/Questions</label>
25 <textarea name="13005" id="13005" onchange="" cols="40" rows="10" class="standard"></textarea>
26</p>
27
28
29<p class="fRAQFormIndustry pd-radio required ">
30 <label class="field-label" for="13039">Industry</label>
31 <span class="value"><span class="" style="">
32 <input type="radio" name="13039[]" id="147771_47771" value="47771" onchange="" />
33 <label class="inline" for="147771_47771">Auto Repair / Dealership</label>
34 </span><span class="" style="">
35 <input type="radio" name="13039[]" id="147773_47773" value="47773" onchange="" />
36 <label class="inline" for="147773_47773">Cleanroom</label>
37 </span><span class="" style="">
38 <input type="radio" name="13039[]" id="147775_47775" value="47775" onchange="" />
39 <label class="inline" for="147775_47775">Food Processing</label>
40 </span><span class="" style="">
41 <input type="radio" name="13039[]" id="147777_47777" value="47777" onchange="" />
42 <label class="inline" for="147777_47777">Healthcare</label>
43 </span><span class="" style="">
44 <input type="radio" name="13039[]" id="147779_47779" value="47779" onchange="" />
45 <label class="inline" for="147779_47779">Manufacturing</label>
46 </span><span class="" style="">
47 <input type="radio" name="13039[]" id="147781_47781" value="47781" onchange="" />
48 <label class="inline" for="147781_47781">Restaurant / Bar</label>
49 </span><span class="" style="">
50 <input type="radio" name="13039[]" id="147783_47783" value="47783" onchange="" />
51 <label class="inline" for="147783_47783">Retail</label>
52 </span><span class="" style="">
53 <input type="radio" name="13039[]" id="147785_47785" value="47785" onchange="" />
54 <label class="inline" for="147785_47785">Other</label>
55 </span></span>
56</p>
57<p class="fCustom_LR_FormServices pd-checkbox required ">
58 <label class="field-label" for="13007">Products</label>
59 <span class="value"><span>
60 <input type="checkbox" name="13007_47921" id="13007_47921" value="47921" onchange="" />
61 <label class="inline" for="13007_47921">Uniforms or Apparel</label>
62 </span><span>
63 <input type="checkbox" name="13007_47923" id="13007_47923" value="47923" onchange="" />
64 <label class="inline" for="13007_47923">Mats, Mops or Towels</label>
65 </span><span>
66 <input type="checkbox" name="13007_47925" id="13007_47925" value="47925" onchange="" />
67 <label class="inline" for="13007_47925">First Aid or Safety Products</label>
68 </span><span>
69 <input type="checkbox" name="13007_47927" id="13007_47927" value="47927" onchange="" />
70 <label class="inline" for="13007_47927">Restroom Supplies or Hand Sanitizer</label>
71 </span><span>
72 <input type="checkbox" name="13007_47929" id="13007_47929" value="47929" onchange="" />
73 <label class="inline" for="13007_47929">Cleaning Chemicals</label>
74 </span></span>
75</p>
76<p class="fCustom_LR_FormEmployees pd-radio required ">
77 <label class="field-label" for="13009">Number of Employees</label>
78 <span class="value"><span class="" style="">
79 <input type="radio" name="13009[]" id="13009_47765_47765" value="47765" onchange="" />
80 <label class="inline" for="13009_47765_47765">1-99</label>
81 </span><span class="" style="">
82 <input type="radio" name="13009[]" id="13009_47767_47767" value="47767" onchange="" />
83 <label class="inline" for="13009_47767_47767">100-249</label>
84 </span><span class="" style="">
85 <input type="radio" name="13009[]" id="13009_47769_47769" value="47769" onchange="" />
86 <label class="inline" for="13009_47769_47769">250+</label>
87 </span></span>
88</p>
89<p class="form-field group-alt2 form-field-col row4 Custom_LR_FormMulitLocation pd-radio ">
90 <label class="field-label" for="13011">We Have Multiple Locations</label>
91 <span class="value"><span class="" style="">
92 <input type="radio" name="13011[]" id="13011_47787_47787" value="47787" onchange="" />
93 <label class="inline" for="13011_47787_47787">Yes</label>
94 </span><span class="" style="">
95 <input type="radio" name="13011[]" id="13011_47789_47789" value="47789" onchange="" />
96 <label class="inline" for="13011_47789_47789">No</label>
97 </span></span>
98</p>
99
100
101<p class="form-field Saved_Items pd-hidden hidden ">
102 <label>Saved Item Hidden</label>
103 <input type="text" name="14604" id="14604" value="" />
104 <span id="error_for_14604" style="display:none"></span> </p>
**
ANSWER
Answered 2021-Dec-06 at 18:09Here's one way. You can just put a change
event listener on the form tag - any changes to the form will trigger the script. The string that gets written into the hidden field is JSON and it can be easily decoded on the back end.
1$(document).ready(function() {
2 $(function(){ $('#13005,#14604').on("keyup",function(){
3 commentField = $("#13005").val(); + " || "
4 products = $("p.Custom_LR_FormServices input:checkbox:checked").map(function(){return $(this).val()}).get();
5 industryField = $("p.RAQFormIndustry input:checkbox:checked").map(function(){return $(this).val()}).get();
6 numberEmployees = $;
7 multipleLocations = $;
8 hiddenField = commentField + " || " + products + " || " + industryField + "||" + numberEmployees + " || " + multipleLocations;
9 $("#14604").val(hiddenField);
10 });
11 });
12 });<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
13<p class="email pd-text required ">
14 <label class="field-label" for="12993">Email</label>
15 <input type="text" name="12993" id="12993" value="" class="text" size="30" maxlength="255" onfocus="" />
16</p>
17
18<p class="company pd-text required ">
19 <label class="field-label" for="12995">Business Name</label>
20 <input type="text" name="12995" id="12995" value="" class="text" size="30" maxlength="255" onchange="" onfocus="" />
21</p>
22
23<p class="comments pd-textarea ">
24 <label class="field-label" for="13005">Comments/Questions</label>
25 <textarea name="13005" id="13005" onchange="" cols="40" rows="10" class="standard"></textarea>
26</p>
27
28
29<p class="fRAQFormIndustry pd-radio required ">
30 <label class="field-label" for="13039">Industry</label>
31 <span class="value"><span class="" style="">
32 <input type="radio" name="13039[]" id="147771_47771" value="47771" onchange="" />
33 <label class="inline" for="147771_47771">Auto Repair / Dealership</label>
34 </span><span class="" style="">
35 <input type="radio" name="13039[]" id="147773_47773" value="47773" onchange="" />
36 <label class="inline" for="147773_47773">Cleanroom</label>
37 </span><span class="" style="">
38 <input type="radio" name="13039[]" id="147775_47775" value="47775" onchange="" />
39 <label class="inline" for="147775_47775">Food Processing</label>
40 </span><span class="" style="">
41 <input type="radio" name="13039[]" id="147777_47777" value="47777" onchange="" />
42 <label class="inline" for="147777_47777">Healthcare</label>
43 </span><span class="" style="">
44 <input type="radio" name="13039[]" id="147779_47779" value="47779" onchange="" />
45 <label class="inline" for="147779_47779">Manufacturing</label>
46 </span><span class="" style="">
47 <input type="radio" name="13039[]" id="147781_47781" value="47781" onchange="" />
48 <label class="inline" for="147781_47781">Restaurant / Bar</label>
49 </span><span class="" style="">
50 <input type="radio" name="13039[]" id="147783_47783" value="47783" onchange="" />
51 <label class="inline" for="147783_47783">Retail</label>
52 </span><span class="" style="">
53 <input type="radio" name="13039[]" id="147785_47785" value="47785" onchange="" />
54 <label class="inline" for="147785_47785">Other</label>
55 </span></span>
56</p>
57<p class="fCustom_LR_FormServices pd-checkbox required ">
58 <label class="field-label" for="13007">Products</label>
59 <span class="value"><span>
60 <input type="checkbox" name="13007_47921" id="13007_47921" value="47921" onchange="" />
61 <label class="inline" for="13007_47921">Uniforms or Apparel</label>
62 </span><span>
63 <input type="checkbox" name="13007_47923" id="13007_47923" value="47923" onchange="" />
64 <label class="inline" for="13007_47923">Mats, Mops or Towels</label>
65 </span><span>
66 <input type="checkbox" name="13007_47925" id="13007_47925" value="47925" onchange="" />
67 <label class="inline" for="13007_47925">First Aid or Safety Products</label>
68 </span><span>
69 <input type="checkbox" name="13007_47927" id="13007_47927" value="47927" onchange="" />
70 <label class="inline" for="13007_47927">Restroom Supplies or Hand Sanitizer</label>
71 </span><span>
72 <input type="checkbox" name="13007_47929" id="13007_47929" value="47929" onchange="" />
73 <label class="inline" for="13007_47929">Cleaning Chemicals</label>
74 </span></span>
75</p>
76<p class="fCustom_LR_FormEmployees pd-radio required ">
77 <label class="field-label" for="13009">Number of Employees</label>
78 <span class="value"><span class="" style="">
79 <input type="radio" name="13009[]" id="13009_47765_47765" value="47765" onchange="" />
80 <label class="inline" for="13009_47765_47765">1-99</label>
81 </span><span class="" style="">
82 <input type="radio" name="13009[]" id="13009_47767_47767" value="47767" onchange="" />
83 <label class="inline" for="13009_47767_47767">100-249</label>
84 </span><span class="" style="">
85 <input type="radio" name="13009[]" id="13009_47769_47769" value="47769" onchange="" />
86 <label class="inline" for="13009_47769_47769">250+</label>
87 </span></span>
88</p>
89<p class="form-field group-alt2 form-field-col row4 Custom_LR_FormMulitLocation pd-radio ">
90 <label class="field-label" for="13011">We Have Multiple Locations</label>
91 <span class="value"><span class="" style="">
92 <input type="radio" name="13011[]" id="13011_47787_47787" value="47787" onchange="" />
93 <label class="inline" for="13011_47787_47787">Yes</label>
94 </span><span class="" style="">
95 <input type="radio" name="13011[]" id="13011_47789_47789" value="47789" onchange="" />
96 <label class="inline" for="13011_47789_47789">No</label>
97 </span></span>
98</p>
99
100
101<p class="form-field Saved_Items pd-hidden hidden ">
102 <label>Saved Item Hidden</label>
103 <input type="text" name="14604" id="14604" value="" />
104 <span id="error_for_14604" style="display:none"></span> </p>$('#theForm').on('change', function() {
105 let vals = [];
106 let prod = [], ind = [];
107 $(".fCustom_LR_FormServices input:checked").each(function(){ prod.push(getTextFromElID($(this).attr('id')))})
108 vals.push({'commentField': $("#13005").val() || ''})
109 vals.push({'products': prod || []})
110 vals.push({'industryField': getTextFromElID($(".fRAQFormIndustry input:checked").attr('id')) || ''})
111 vals.push({'numberEmployees': getTextFromElID($(".fCustom_LR_FormEmployees input:checked").attr('id')) || ''})
112 vals.push({'multipleLocations': getTextFromElID($(".Custom_LR_FormMulitLocation input:checked").attr('id')) || ''})
113 $("#14604").val(JSON.stringify(vals));
114})
115
116function getTextFromElID(id) {
117return $(`[for=${id}]`).text().trim();
118}
1$(document).ready(function() {
2 $(function(){ $('#13005,#14604').on("keyup",function(){
3 commentField = $("#13005").val(); + " || "
4 products = $("p.Custom_LR_FormServices input:checkbox:checked").map(function(){return $(this).val()}).get();
5 industryField = $("p.RAQFormIndustry input:checkbox:checked").map(function(){return $(this).val()}).get();
6 numberEmployees = $;
7 multipleLocations = $;
8 hiddenField = commentField + " || " + products + " || " + industryField + "||" + numberEmployees + " || " + multipleLocations;
9 $("#14604").val(hiddenField);
10 });
11 });
12 });<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
13<p class="email pd-text required ">
14 <label class="field-label" for="12993">Email</label>
15 <input type="text" name="12993" id="12993" value="" class="text" size="30" maxlength="255" onfocus="" />
16</p>
17
18<p class="company pd-text required ">
19 <label class="field-label" for="12995">Business Name</label>
20 <input type="text" name="12995" id="12995" value="" class="text" size="30" maxlength="255" onchange="" onfocus="" />
21</p>
22
23<p class="comments pd-textarea ">
24 <label class="field-label" for="13005">Comments/Questions</label>
25 <textarea name="13005" id="13005" onchange="" cols="40" rows="10" class="standard"></textarea>
26</p>
27
28
29<p class="fRAQFormIndustry pd-radio required ">
30 <label class="field-label" for="13039">Industry</label>
31 <span class="value"><span class="" style="">
32 <input type="radio" name="13039[]" id="147771_47771" value="47771" onchange="" />
33 <label class="inline" for="147771_47771">Auto Repair / Dealership</label>
34 </span><span class="" style="">
35 <input type="radio" name="13039[]" id="147773_47773" value="47773" onchange="" />
36 <label class="inline" for="147773_47773">Cleanroom</label>
37 </span><span class="" style="">
38 <input type="radio" name="13039[]" id="147775_47775" value="47775" onchange="" />
39 <label class="inline" for="147775_47775">Food Processing</label>
40 </span><span class="" style="">
41 <input type="radio" name="13039[]" id="147777_47777" value="47777" onchange="" />
42 <label class="inline" for="147777_47777">Healthcare</label>
43 </span><span class="" style="">
44 <input type="radio" name="13039[]" id="147779_47779" value="47779" onchange="" />
45 <label class="inline" for="147779_47779">Manufacturing</label>
46 </span><span class="" style="">
47 <input type="radio" name="13039[]" id="147781_47781" value="47781" onchange="" />
48 <label class="inline" for="147781_47781">Restaurant / Bar</label>
49 </span><span class="" style="">
50 <input type="radio" name="13039[]" id="147783_47783" value="47783" onchange="" />
51 <label class="inline" for="147783_47783">Retail</label>
52 </span><span class="" style="">
53 <input type="radio" name="13039[]" id="147785_47785" value="47785" onchange="" />
54 <label class="inline" for="147785_47785">Other</label>
55 </span></span>
56</p>
57<p class="fCustom_LR_FormServices pd-checkbox required ">
58 <label class="field-label" for="13007">Products</label>
59 <span class="value"><span>
60 <input type="checkbox" name="13007_47921" id="13007_47921" value="47921" onchange="" />
61 <label class="inline" for="13007_47921">Uniforms or Apparel</label>
62 </span><span>
63 <input type="checkbox" name="13007_47923" id="13007_47923" value="47923" onchange="" />
64 <label class="inline" for="13007_47923">Mats, Mops or Towels</label>
65 </span><span>
66 <input type="checkbox" name="13007_47925" id="13007_47925" value="47925" onchange="" />
67 <label class="inline" for="13007_47925">First Aid or Safety Products</label>
68 </span><span>
69 <input type="checkbox" name="13007_47927" id="13007_47927" value="47927" onchange="" />
70 <label class="inline" for="13007_47927">Restroom Supplies or Hand Sanitizer</label>
71 </span><span>
72 <input type="checkbox" name="13007_47929" id="13007_47929" value="47929" onchange="" />
73 <label class="inline" for="13007_47929">Cleaning Chemicals</label>
74 </span></span>
75</p>
76<p class="fCustom_LR_FormEmployees pd-radio required ">
77 <label class="field-label" for="13009">Number of Employees</label>
78 <span class="value"><span class="" style="">
79 <input type="radio" name="13009[]" id="13009_47765_47765" value="47765" onchange="" />
80 <label class="inline" for="13009_47765_47765">1-99</label>
81 </span><span class="" style="">
82 <input type="radio" name="13009[]" id="13009_47767_47767" value="47767" onchange="" />
83 <label class="inline" for="13009_47767_47767">100-249</label>
84 </span><span class="" style="">
85 <input type="radio" name="13009[]" id="13009_47769_47769" value="47769" onchange="" />
86 <label class="inline" for="13009_47769_47769">250+</label>
87 </span></span>
88</p>
89<p class="form-field group-alt2 form-field-col row4 Custom_LR_FormMulitLocation pd-radio ">
90 <label class="field-label" for="13011">We Have Multiple Locations</label>
91 <span class="value"><span class="" style="">
92 <input type="radio" name="13011[]" id="13011_47787_47787" value="47787" onchange="" />
93 <label class="inline" for="13011_47787_47787">Yes</label>
94 </span><span class="" style="">
95 <input type="radio" name="13011[]" id="13011_47789_47789" value="47789" onchange="" />
96 <label class="inline" for="13011_47789_47789">No</label>
97 </span></span>
98</p>
99
100
101<p class="form-field Saved_Items pd-hidden hidden ">
102 <label>Saved Item Hidden</label>
103 <input type="text" name="14604" id="14604" value="" />
104 <span id="error_for_14604" style="display:none"></span> </p>$('#theForm').on('change', function() {
105 let vals = [];
106 let prod = [], ind = [];
107 $(".fCustom_LR_FormServices input:checked").each(function(){ prod.push(getTextFromElID($(this).attr('id')))})
108 vals.push({'commentField': $("#13005").val() || ''})
109 vals.push({'products': prod || []})
110 vals.push({'industryField': getTextFromElID($(".fRAQFormIndustry input:checked").attr('id')) || ''})
111 vals.push({'numberEmployees': getTextFromElID($(".fCustom_LR_FormEmployees input:checked").attr('id')) || ''})
112 vals.push({'multipleLocations': getTextFromElID($(".Custom_LR_FormMulitLocation input:checked").attr('id')) || ''})
113 $("#14604").val(JSON.stringify(vals));
114})
115
116function getTextFromElID(id) {
117return $(`[for=${id}]`).text().trim();
118}<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
119<form id='theForm'>
120 <p class="email pd-text required ">
121 <label class="field-label" for="12993">Email</label>
122 <input type="text" name="12993" id="12993" value="" class="text" size="30" maxlength="255" onfocus="" />
123 </p>
124
125 <p class="company pd-text required ">
126 <label class="field-label" for="12995">Business Name</label>
127 <input type="text" name="12995" id="12995" value="" class="text" size="30" maxlength="255" onchange="" onfocus="" />
128 </p>
129
130 <p class="comments pd-textarea ">
131 <label class="field-label" for="13005">Comments/Questions</label>
132 <textarea name="13005" id="13005" cols="40" rows="10" class="standard saver"></textarea>
133 </p>
134
135
136 <p class="fRAQFormIndustry pd-radio required ">
137 <label class="field-label" for="13039">Industry</label>
138 <span class="value"><span class="" style="">
139 <input type="radio" name="13039[]" id="147771_47771" value="47771" />
140 <label class="inline" for="147771_47771">Auto Repair / Dealership</label>
141 </span><span class="" style="">
142 <input type="radio" name="13039[]" id="147773_47773" value="47773" />
143 <label class="inline" for="147773_47773">Cleanroom</label>
144 </span><span class="" style="">
145 <input type="radio" name="13039[]" id="147775_47775" value="47775" />
146 <label class="inline" for="147775_47775">Food Processing</label>
147 </span><span class="" style="">
148 <input type="radio" name="13039[]" id="147777_47777" value="47777" />
149 <label class="inline" for="147777_47777">Healthcare</label>
150 </span><span class="" style="">
151 <input type="radio" name="13039[]" id="147779_47779" value="47779" />
152 <label class="inline" for="147779_47779">Manufacturing</label>
153 </span><span class="" style="">
154 <input type="radio" name="13039[]" id="147781_47781" value="47781" />
155 <label class="inline" for="147781_47781">Restaurant / Bar</label>
156 </span><span class="" style="">
157 <input type="radio" name="13039[]" id="147783_47783" value="47783" />
158 <label class="inline" for="147783_47783">Retail</label>
159 </span><span class="" style="">
160 <input type="radio" name="13039[]" id="147785_47785" value="47785" />
161 <label class="inline" for="147785_47785">Other</label>
162 </span></span>
163 </p>
164 <p class="fCustom_LR_FormServices pd-checkbox required ">
165 <label class="field-label" for="13007">Products</label>
166 <span class="value"><span>
167 <input type="checkbox" name="13007_47921" id="13007_47921" value="47921" />
168 <label class="inline" for="13007_47921">Uniforms or Apparel</label>
169 </span><span>
170 <input type="checkbox" name="13007_47923" id="13007_47923" value="47923" />
171 <label class="inline" for="13007_47923">Mats, Mops or Towels</label>
172 </span><span>
173 <input type="checkbox" name="13007_47925" id="13007_47925" value="47925" />
174 <label class="inline" for="13007_47925">First Aid or Safety Products</label>
175 </span><span>
176 <input type="checkbox" name="13007_47927" id="13007_47927" value="47927" />
177 <label class="inline" for="13007_47927">Restroom Supplies or Hand Sanitizer</label>
178 </span><span>
179 <input type="checkbox" name="13007_47929" id="13007_47929" value="47929" />
180 <label class="inline" for="13007_47929">Cleaning Chemicals</label>
181 </span></span>
182 </p>
183 <p class="fCustom_LR_FormEmployees pd-radio required ">
184 <label class="field-label" for="13009">Number of Employees</label>
185 <span class="value"><span class="" style="">
186 <input type="radio" name="13009[]" id="13009_47765_47765" value="47765" />
187 <label class="inline" for="13009_47765_47765">1-99</label>
188 </span><span class="" style="">
189 <input type="radio" name="13009[]" id="13009_47767_47767" value="47767" />
190 <label class="inline" for="13009_47767_47767">100-249</label>
191 </span><span class="" style="">
192 <input type="radio" name="13009[]" id="13009_47769_47769" value="47769" />
193 <label class="inline" for="13009_47769_47769">250+</label>
194 </span></span>
195 </p>
196 <p class="form-field group-alt2 form-field-col row4 Custom_LR_FormMulitLocation pd-radio ">
197 <label class="field-label" for="13011">We Have Multiple Locations</label>
198 <span class="value"><span class="" style="">
199 <input type="radio" name="13011[]" id="13011_47787_47787" value="47787" />
200 <label class="inline" for="13011_47787_47787">Yes</label>
201 </span><span class="" style="">
202 <input type="radio" name="13011[]" id="13011_47789_47789" value="47789" />
203 <label class="inline" for="13011_47789_47789">No</label>
204 </span></span>
205 </p>
206
207
208 <p class="form-field Saved_Items pd-hidden hidden ">
209 <label>Saved Item Hidden</label>
210 <input type="text" name="14604" id="14604" value="" style='width:100%;' />
211 <span id="error_for_14604" style="display:none"></span> </p>
212</form>
Community Discussions contain sources that include Stack Exchange Network
Tutorials and Learning Resources in Healthcare
Tutorials and Learning Resources are not available at this moment for Healthcare