You can find the LOINC table here and download as a CSV file. You may need to make an account.
I ran into a problem loading the table as is due to there being a column named “Status” and another called “System” both of which are reserved words in MariaDB.
I removed the column names, and saved the .csv file to the appropriate directory, in my case:
C:\xampp\mysql\data\openemr\LoincNoHeaders.csv
“To avoid mysql/mariadb reserved keyword conflicts, good practice to get in the habit of surrounding all column/table names with backtics[on the ~ key next to 1 on US keyboards] in queries (and avoid using caps in table names, which causes a world of hurt when trying to migrate instances from windows to linux and vice versa; btw using caps in column names is ok)”
I used the following in the SQL command window. Not the most elegant solution but it worked. Note that I actually typed out the column names of the whole table. You’ll want to do the same in place of the '…'s
Where VARCHAR(length) is the variable type.
CREATE TABLE openemr.loinc
(
LOINC_NUM
VARCHAR(255),
…
…
ValidHL7AttachmentRequest
VARCHAR(255)
);
LOAD DATA INFILE ‘LoincNoHeaders.csv’
INTO TABLE openemr.loinc
FIELDS TERMINATED BY ‘,’;
I saw there was an import tool in PHPmyAdmin if you’re using xampp. It didn’t work for me, possibly due to the column names. For larger files you may need to adjust the settings in php.ini.
This just brings the code table into the database. You’d need to write some code to access it from the web interface.
Hope this helps.